JDK-8159675 : Define specification for JVM_GetJvmArguments
  • Type: Task
  • Component: core-libs
  • Sub-Component: java.lang
  • Affected Version: 9
  • Priority: P3
  • Status: Closed
  • Resolution: Won't Fix
  • Submitted: 2016-06-16
  • Updated: 2025-01-07
  • Resolved: 2025-01-07
Related Reports
Relates :  
Relates :  
Description
VM argument parsing includes the following:

JAVA_TOOLS_OPTION environment variable
Options passed via JNI invocation API
_JAVA_OPTION environment variable

-XX:VMOptionsFile is intended to protect the password not to be made visible from ps.  Similiarly, it should not be shown in jps.  -XX:Flags includes only VM -XX flags but no -XX prefix is specified in the Flags file.

java.lang.management.RuntimeMXBean::getInputArguments() specifies to return the VM input arguments.  It has a security permission check.  

In addition, -Djava.class.path=<classpath> is not included in the returned value of JVM_GetJvmArguments.

JVM_GetJvmArguments and other APIs need to be examined and specified what input arguments should be included.
Comments
Internal implementation. Close it as very low priority. It can be reopen when it becomes an issue.
07-01-2025

These system properties are excluded from JVM_GetJvmArguments: if (!match_option(option, "-Djava.class.path", &tail) && !match_option(option, "-Dsun.java.command", &tail) && !match_option(option, "-Dsun.java.launcher", &tail)) { build_jvm_args(option->optionString); } "sun.java.command" and "sun.java.launcher" are implementation-specific that have no issue to exclude. There may be custom launcher setting -Djava.class.path when creating the HotSpot VM via JNI invocation API and that is considered as an input argument.
16-06-2016