Skip to content

Latest commit

 

History

History
39 lines (26 loc) · 988 Bytes

README.md

File metadata and controls

39 lines (26 loc) · 988 Bytes

dynamiccompiler

Compile java code at runtime dynamically.

maven travis

Dependency

<dependency>
    <groupId>com.github.henryhuang</groupId>
    <artifactId>dynamiccompiler</artifactId>
    <version>0.1.0</version>
</dependency>

Usage

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);
	

License

MIT