Compile java code at runtime dynamically.
<dependency>
<groupId>com.github.henryhuang</groupId>
<artifactId>dynamiccompiler</artifactId>
<version>0.1.0</version>
</dependency>
ClassGenerator builder = new ClassGenerator(".");
Class<?> testClass = builder.generate("Test",
"public class Test{public static void main(String[] args){System.out.println(\"Test!\");}}");
String[] params = null;
testClass.getMethod("main", String[].class).invoke(null, (Object) params);