"platform modules"

Alex Buckley Alex.Buckley at Sun.COM
Mon Apr 13 11:57:25 PDT 2009


Jonathan Gibbons wrote:
> We need to tie down where platform (java.lang.* etc) classes come from, 
> and what potential there is to override any system defaults.
> 
> For example, what is the relationship between -source, -target and 
> platform class path?
> 
> If I run a JDK 8 javac with -source 7, do I get a JDK7 platform path?

(Perhaps defining -platformclasspath precisely would be helpful.)

I'd say yes - unless the code you're compiling 'requires' a "core JDK" 
module (name TBD...) in which case the required version is authoritative.

> If I run a JDK 8 javac and specify a version 7 platform in my 
> module-info, is that legal?

Certainly.

> Is there any interaction of check with -source? What if JDK 8 introduces 
> language features that require new JDK 8 api.

Suppose an enum-style feature is added in 8 which requires core JDK 
support. Then, the code being compiled is in error if it 'requires' 
specifically a pre-8 core JDK module.

> Now, repeat questions for java, not javac ;-)

Why would the answers be different?

Alex



More information about the jigsaw-dev mailing list