JDK9 Modules

Stephen Felts stephen.felts at oracle.com
Wed Jul 6 14:40:53 UTC 2016


In the next few weeks, the options will change to the new format and your build will be broken.

 

 

From: Malachi de Ælfweald [mailto:malachid at gmail.com] 
Sent: Wednesday, July 06, 2016 10:30 AM
To: Alan Bateman
Cc: Stephen Felts; jigsaw-dev at openjdk.java.net
Subject: Re: JDK9 Modules

 

I think I must be misunderstanding your suggestion.


If I do:
export _JAVA_OPTIONS="--add-modules=ALL-SYSTEM --add-exports=java.base/HYPERLINK "http://sun.nio.ch"sun.nio.ch=ALL-UNNAMED"

then:

java -version

reports:
Unrecognized option: --add-modules=ALL-SYSTEM
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.

If I do:
export _JAVA_OPTIONS="-Djdk.launcher.addmods=ALL-SYSTEM -Djdk.launcher.addexports.0=java.base/HYPERLINK "http://sun.nio.ch"sun.nio.ch=ALL-UNNAMED"

then:

java -version

reports:
java version "9-ea"
Java(TM) SE Runtime Environment (build 9-ea+123)
Java HotSpot(TM) 64-Bit Server VM (build 9-ea+123, mixed mode)








Malachi de Ælfweald
http://www.google.com/profiles/malachid

 

On Wed, Jul 6, 2016 at 1:55 AM, Alan Bateman <HYPERLINK "mailto:Alan.Bateman at oracle.com" \nAlan.Bateman at oracle.com> wrote:

On 05/07/2016 22:24, Malachi de Ælfweald wrote:

With:
export _JAVA_OPTIONS="-Djdk.launcher.addmods=ALL-SYSTEM
-Djdk.launcher.addexports.0=java.base/HYPERLINK "http://sun.nio.ch" \nsun.nio.ch=ALL-UNNAMED"

no GRADLE_OPTIONS
no options.compilerArgs in build.gradle

1. The dagger project compiles and runs
2. The neo4j project compiles and runs
3. a JDK8 project still compiles and run

Good to hear you got this working but just to add to what Stephen said about the system properties. The jdk.launcher.* properties that are you using here are not documented and are meant to be JDK-internal. They will be going away soon and so the above will likely need to change to "--add-modules=ALL-SYSTEM --add-exports=java.base/HYPERLINK "http://sun.nio.ch" \nsun.nio.ch=ALL-UNNAMED". Also as Stephen noted, using ALL-SYSTEM is probably not what you want here, at least not if you only want @Generated.

-Alan

 


More information about the jigsaw-dev mailing list