Problems with JavacTool & -L

Jonathan Gibbons jonathan.gibbons at oracle.com
Wed Dec 28 02:10:58 PST 2011


On 12/28/2011 02:37 AM, Mandy Chung wrote:
> On 12/27/2011 4:43 PM, Jesse Glick wrote:
>> Is there some reason that (as of 1e829edfb340) 
>> RecognizedOptions.javacOptions includes OptionName.L but 
>> javacToolOptions does not? Passing -L among the 'options' to 
>> JavaCompiler.getTask throws an exception:
>>
>> java.lang.IllegalArgumentException: invalid flag: -L
>>     at 
>> com.sun.tools.javac.api.JavacTool.processOptions(JavacTool.java:231)
>>     at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:199)
>>     at com.sun.tools.javac.api.JavacTool.getTask(JavacTool.java:68)
>>
>
> Possibly just a bug.  Jon is on vacation and will wait for him to 
> confirm.

Sorry, minor bug and victim of a recent refactoring.  Will fix when I 
get back to California.  Note that RecognizedOptions, JavacOption and 
OptionName have been merged into a single new enum, Option.

>
>> (I am trying to run Jigsaw langtools on top of JRE 7, so far without 
>> success: I get "Unable to find package java.lang in classpath or 
>> bootclasspath".)
>
> Jigsaw JDK is built using jigsaw langtools on top of JDK 7 as the boot 
> JDK.  So I expect it should work to run on top of JRE 7.    How do you 
> run it?

This *may* be a side-effect of the above bug. Mandy is right in what she 
says, but that applies to javac as used to build and rebuild JDK. The -L 
flag is the module equivalent of -bootclasspath, and so the message you 
describe might occur when javac is used in module mode to compile client 
code, if the -L flag has not been processed correctly.

-- Jon

>
> Mandy




More information about the jigsaw-dev mailing list