Problems with "-implicit:none"

Jonathan Gibbons jonathan.gibbons at oracle.com
Thu Aug 8 18:19:19 PDT 2013


José,

-implicit:none is intended to affect any/all source files which are read 
by the compiler in order to complete a compilation, but which are not 
explicitly specified on the command line.  The package name is 
irrelevant; the important factor is whether it is specified on the javac 
command line or not.

Note that IDEs and other systems for driving javac, (like Ant) may muddy 
the waters somewhat by determining for themselves what they think should 
best appear on the javac command line.  If you are using such tools, I 
suggest you carefully examine the set of files being fed to javac.

-- Jon

On 08/08/2013 05:43 PM, José Cornado wrote:
> Hello!
>
> I have the following problem with javax.tools.JavaCompiler:
>
> A background jvm, depending on user input from IDE, generates classes 
> dynamically.
>
> This can take time, so to avoid the delay I use the flag 
> "-implicit:none". The IDE provides enough data I can infer if 
> everything is in place and stick to parse/build just the target class. 
>  Because I don't write some streams to disk there are a lot of cases 
> where the *.class is in the correct directory but the *.java does not 
> exist.
>
> Now the problem:
>
> If the target class imports a type from another package/location the 
> flag works great. If the target class imports a class from the same 
> location the JavaCompiler completely ignores this flag and the fact 
> that the *.class exists and looks for the source file which doesn't 
> exist and fails.
>
> Question 1: is this the expected behavior of the compiler.
>
> Question 2: would avoid importing type from the same package change 
> the behavior of the compiler in anyway?
>
> I am running build 1.7.0_25-b15 on a mac
>
>
> Thanks a lot in advance!!!
>
> -- 
> José Cornado
>
> --
>
> home: http://www.efekctive.com
> blog: http://blogging.efekctive.com
> ----------------------
>
> Everything has been said before, but since nobody listens we have to 
> keep going back and beginning all over again.
>
> Andre Gide



More information about the compiler-dev mailing list