java
public class Test {
public static void main(String[] args) throws Exception {
ClassLoader compile = CompilerUtil.getCompiler(null)
.addSource("Hello", "public class Hello{public static void main(String[] args){System.out.println(\"Hello World!\");}}")
.compile();
Class<?> hello = compile.loadClass("Hello");
// 实例化对象c
// Object obj = ReflectUtil.newInstance(hello);
hello.getMethod("main", String[].class).invoke(null, (Object) new String[]{});
}
}