I use the class javax.tools.JavaCompiler (jdk6) to compile a source file, but the source file depends on some jar file. How to set the classpath of the javax.tools.JavaCompiler?
I use the class javax.tools.JavaCompiler (jdk6) to compile a source file, but the source
Share
The javax.tools.JavaCompiler#getTask() method takes an
optionsparameter that allows to set compiler options. The following message describes an easy way to set them in order to access the calling program’s classpath:All you’ll need then is to get the proper classpath set when running the calling program.