JDK9 Modules

Malachi de Ælfweald malachid at gmail.com
Wed Jul 6 14:30:14 UTC 2016


I think I must be misunderstanding your suggestion.

If I do:
export _JAVA_OPTIONS="--add-modules=ALL-SYSTEM --add-exports=java.base/
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/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 <Alan.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/sun.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/sun.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