File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ image:https://sonarcloud.io/api/project_badges/measure?project=OpenHFT_Java-Runt
1616This takes a String, compiles it and loads it returning you a class from what you built.
1717By default it uses the current ClassLoader. It supports nested classes, otherwise builds one class at a time.
1818
19- == On maven central
19+ == On Maven Central
2020
2121You can include in your project with
2222
@@ -44,15 +44,15 @@ String javaCode = "package mypackage;\n" +
4444Class aClass = CompilerUtils.CACHED_COMPILER.loadFromJava(className, javaCode);
4545Runnable runner = (Runnable) aClass.newInstance();
4646runner.run();
47- ````
47+ ```
4848
4949I suggest making your class implement a KnownInterface of your choice as this will allow you to call/manipulate instances of you generated class.
5050
5151Another more hacky way is to use this to override a class, provided it hasn't been loaded already.
5252This means you can redefine an existing class and provide the methods and fields used match,
5353you have compiler redefine a class and code already compiled to use the class will still work.
5454
55- ## Using the CachedCompiler.
55+ == Using the CachedCompiler.
5656
5757In this example, you can configure the compiler to write the files to a specific directory when you are in debug mode.
5858
You can’t perform that action at this time.
0 commit comments