javac: "legacy" mode

Alan Bateman Alan.Bateman at oracle.com
Tue Jan 31 06:06:20 PST 2012


On 28/01/2012 16:37, Jonathan Gibbons wrote:
> :
> I think it is more helpful to have javac just "do the right thing".   
> There are three recognizable types of compilation for javac, roughly 
> corresponding to 0, 1, many module-info files in the compilation.
>
> legacy mode:
>     no module-path option, no module-info to be compiled or on classpath
>     source hierarchy is organized by packages, as now
>     output dir will be organized by packages, as now
>
> single module mode:
>     class path set, or module path not set
>     source hierarchy is organized by packages, as now
>     output dir will be organized by packages, as now
>
> multi-module mode
>     module path set but not class path.
>     source hierarchy must be organized by modules.
>     output dir will be organized by modules
>
> The presumption is that in legacy mode, you should have access to all 
> JDK classes.  In either module mode, unless you specify otherwise, a 
> module will only have access to the classes in the java.base module.
>
> I also think we should add to -verbose, so that javac can be more 
> informative about the type of compilation it is doing
>
> -- Jon
Joining this thread a bit late but I think it is the case that javac has 
to do the right thing. There would be a bounty on your head if the world 
had to change their command-lines to compile existing code the way it 
has always compiled. So if there isn't any module compilation units then 
would it mean that jdk at 8 (as opposed to jdk.base at 8 when compiling in any 
module mode) would be required?

-Alan.



More information about the jigsaw-dev mailing list