Java compiler API not supporting non-standard options such as -XDignore.symbol.file?
Jonathan Gibbons
jonathan.gibbons at oracle.com
Tue Oct 15 16:13:00 PDT 2013
On 10/15/2013 03:46 PM, Peter Niederwieser wrote:
> Jon,
>
> thanks for the clear answer. We already use `com.sun.tools.javac.Main` on JDK5, but haven't seriously considered using it on JDK6+. Fpr the time being, `javax.tools.JavaCompiler.run` may be our best option, although we'll certainly get to the point where we want to leverage the more advanced features of the compiler API. Two final question:
>
> * Is there any particular reason why the compiler API doesn't support the exact same options as the corresponding command-line compiler? Is it conceivable that this would be fixed?
The options are by and large the same. Some of the exceptions are
options like -help, -version, which don't make so much sense on the
API. -J will never be accepted by the API because it affects the
underlying JVM.
> * Could you explain how we can get the same effect as `-XDignore.symbol.file` using the compiler API?
Set the PLATFORM_CLASS_PATH, using JavaFileManager.setLocation for the
file manager you use for the compilation.
>
> Thanks
> Peter
-- Jon
More information about the compiler-dev
mailing list