讀源碼看見(jiàn)一個(gè)配置類,EMMMM
ClassLoader parent = GroovyScript.class.getClassLoader();
CompilerConfiguration configuration = new CompilerConfiguration();
configuration.setSourceEncoding("UTF-8"); // 設(shè)置編碼
GroovyClassLoader loader = new GroovyClassLoader(parent,configuration);