JDK-8173128 : hotspot doesn't recognise new jigsaw options passed through _JAVA_OPTIONS
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Not an Issue
  • Submitted: 2017-01-20
  • Updated: 2017-01-30
  • Resolved: 2017-01-27
Related Reports
Relates :  
Relates :  
Relates :  
Description
to reproduce 
$ export _JAVA_OPTIONS="--add-opens java.base/java.util=ALL-UNNAMED"
$ java -version

Unrecognized option: --add-opens
Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occurred. Program will exit.
Comments
[~hseigel] Thanks for jumping in on this one.
27-01-2017

CCC 8136930 says the following w.r.t the new module options: The java launcher will pass options down to the VM via JNI invocation API. The VM will take the long form options, and the options with argument will be passed as one single string with `=` delimiter. The '=' is required. The VM doesn't handle options containing blanks.
27-01-2017

Support for "--add-opens" was added by this changeset: $ hg log -r 12388 changeset: 12388:8953c0318163 parent: 12385:1ae8e92ed3e4 user: alanb date: Thu Dec 01 08:56:41 2016 +0000 summary: 8169069: Module system implementation refresh (11/2016) I remember there were discussions that we would not modify VM argument processing to add support for spaces between options and option arguments, but I couldn't easily find a reference to those discussions. [~hseigel] - Can you find a proper reference to this decision?
27-01-2017

_JAVA_OPTIONS is handled by the VM not the launcher, so please reassign it to hotspot.
20-01-2017

yes it works
20-01-2017

Can you try _JAVA_OPTIONS="--add-opens=java.base/java.util=ALL-UNNAMED" ? I expect this should work because the VM does not support spaces in options.
20-01-2017