JDK-8227722 : Update JNI Spec w.r.t. VM implementation-specific long form options
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: 9,14
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2019-07-16
  • Updated: 2022-05-19
  • Resolved: 2020-06-23
Related Reports
CSR :  
Relates :  
Description
The fix for JDK-8227497 needs to be clarified as it might be confused as Java SE standard.  The long form options are HotSpot VM specific options. 

In addition, JNI spec states that "Non-standard option names must begin with "-X" or an underscore ("_").    

The above would need to be updated to include option names begin with "--".  This probably requires CSR.
Comments
Runtime Triage: This is not on our current list of priorities. We will consider this feature if we receive additional customer requirements.
23-06-2020

The specification of JNI_CreateJavaVM mentions the non-standard options that *MUST* begin with "-X" or "_". This should be updated to allow the long form option names beginning with "--". The following sentences are occurrences in the JNI spec that references "-X" or "_" : If ignoreUnrecognized is JNI_TRUE, JNI_CreateJavaVM ignores all unrecognized option strings that begin with "-X" or "_" In addition, each VM implementation may support its own set of non-standard option strings. Non-standard option names must begin with "-X" or an underscore ("_"). One suggested spec update: If ignoreUnrecognized is JNI_TRUE, JNI_CreateJavaVM ignores all unrecognized option strings. : In addition, each VM implementation may support its own set of non-standard option strings. Non-standard option names must begin with "-X" or an underscore ("_") or they are long-form options starting with "--". For example, the JDK supports -Xms and -Xmx options to allow programmers specify the initial and maximum heap size. Options that begin with "-X" are accessible from the "java" command line. Long-form options use '=' as the separator for any argument value and they must be passed as option string using the "<option>=<value>" format. For example, to specify the module path to "mlib", set `options[i].optionsString` = "--module-path=mlib";`.
30-10-2019

Suggested improvements from Mandy's comments in JDK-8227497: The HotSpot VM will accept options of the long form name use `=` as the separator for any argument value as documented in https://openjdk.java.net/jeps/293. It'd be better to document the format `--<name>=<value>` for options starting with `--` and use --module-path as an example. What I suggested was to add an implementation note after "In addition, each VM implementation may support its own ..." to extend to document the long form option syntax and include an example or not. It's not part of the JNI specification. The full list of HotSpot VM supported options should be referred to the java launcher man page rather than listing all these options in JNI specification.
16-07-2019