JDK-8233142 : Update JNI Spec w.r.t. VM implementation-specific long form options
  • Type: CSR
  • Component: hotspot
  • Sub-Component: runtime
  • Priority: P3
  • Status: Closed
  • Resolution: Withdrawn
  • Fix Versions: 14
  • Submitted: 2019-10-29
  • Updated: 2022-05-19
  • Resolved: 2022-05-19
Related Reports
CSR :  
Description
Summary
-------

Add text to Chapter 5 of the JNI Spec that clarifies how to pass long-form options, such as --add-exports, to JNI_CreateJavaVM().

Problem
-------

The JNI Spec needs to tell users how to correctly pass long-form options to the JVM when using the JNI_CreateJavaVM() API.

Solution
--------

Add the needed text to the JNI_CreateJavaVM() description in chapter 5 of the JNI Spec:


Specification
-------------

The detailed changes are to add the following paragraph to the description of JNI_CreateJavaVM in chapter 5 of the JNI Spec.  The paragraph would be placed before the example that is currently in the Spec.

The proposed new paragraph is:

Also, the VM accepts relevant long-form options provided that the option arguments are separated from their option names by '=' and there is no intervening white space. For example, to export java.management/sun.management to ALL-UNNAMED, the option string "--add-exports=java.management/sun.management=ALL-UNNAMED" should be used.

This paragraph will be deleted:

The module related options, `--add-reads`, `--add-exports`, `--add-opens`, `--add-modules`, `--limit-modules`, `--module-path`, `--patch-module`, and `--upgrade-module-path` must be passed as option strings using their "option=value" format instead of their "option value" format.  (Note the required `=` between "option" and "value".)  For example, to export `java.management/sun.management` to `ALL-UNNAMED` pass option string `"--add-exports=java.management/sun.management=ALL-UNNAMED"`.


The  JDK-13 description of JNI_CreateJavaVM in the JNI Spec can be found here:
https://docs.oracle.com/en/java/javase/13/docs/specs/jni/invocation.html#jni_createjavavm
Comments
The proposed change never went ahead so I've marked this as Withdrawn.
19-05-2022

The specification section above should show all changes, additions and deletions to the text. Thanks.
30-10-2019

I was planning to delete the old text as shown in the RFR that I sent out for the main bug.
30-10-2019

I don't quite understand the placement of the new text given that there is existing text that refers to long options: > The module related options, --add-reads, --add-exports, --add-opens, > --add-modules, --limit-modules, --module-path, --patch-module, and --upgrade-module-path must be passed as option strings using their "option=value" format instead of their "option value" format. (Note > the required = between "option" and "value".) For example, to export > java.management/sun.management to ALL-UNNAMED pass option string > "--add-exports=java.management/sun.management=ALL-UNNAMED". I would expect the new text to come before this text and for this text to be modified to accommodate the fact the new text has been added.
30-10-2019

The JNI spec is part of Java SE; changing Scope field accordingly. Moving to Approved.
29-10-2019

Please have an assignee and one or more reviewers of this CSR request.
29-10-2019