Closed yafngzh closed 5 years ago
Execuse me, how can I depend on other jars and classes when using javacompiler? They are all included in my current process. Can I get the classpath variable in an elegant way?
The InMemoryJavaCompiler#useOptions may work.
InMemoryJavaCompiler#useOptions
https://github.com/trung/InMemoryJavaCompiler/blob/d84c404975dc308ee5a418c5af8a6629c5e6c995/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java#L45
I found it when I read the compiler part of another project.
https://github.com/SpoonLabs/astor/blob/38765febb621aff921cedcc451509250e520b656/src/main/java/fr/inria/astor/core/manipulation/bytecode/compiler/tools/JavaXToolsCompiler.java#L46
https://github.com/SpoonLabs/astor/blob/38765febb621aff921cedcc451509250e520b656/src/main/java/fr/inria/astor/core/manipulation/bytecode/compiler/SpoonClassCompiler.java#L81
Execuse me, how can I depend on other jars and classes when using javacompiler? They are all included in my current process. Can I get the classpath variable in an elegant way?