JDK-8157979 : RuntimeMXBean.getInputArguments returns non-VM option when -XX:Flags is used
  • Type: Bug
  • Component: core-svc
  • Sub-Component: java.lang.management
  • Affected Version: 9
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2016-05-26
  • Updated: 2020-02-21
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Relates :  
Description
Code snipplet in Test.java:
   RuntimeMXBean mxbean = ManagementFactory.getRuntimeMXBean();
   System.out.format("mxbean %s%n", mxbean.getInputArguments());

$ cat flags 
+UnlockExperimentalVMOptions +EnableJVMCI

$ java -XX:Flags=flags Test 
mxbean [+UnlockExperimentalVMOptions, +EnableJVMCI, -XX:Flags=flags]

The syntax of Flags file looks like requiring it to drop "-XX:" prefix.  "+UnlockExperimentalVMOptions" and "+EnableJVMCI" are not valid VM option to specify on command-line.

RuntimeMXBean.getInputArguments should return valid VM options.  The correct returned value should be:
[-XX:+UnlockExperimentalVMOptions, -XX:+EnableJVMCI]

or

[-XX:Flags=flag]

Comments
Please update functionality to use new -XX:VMOptionsFile=filename flag.
02-10-2017

I change this to tbd_minor since this does not require an API change.
16-06-2016

Not sure why this bug is deferred to 10 at this stage. ?? That aside, as per 7u and 8u practice, bugs should be targetted to the next major release (ie 10) and then backported to 9u based upon the rules for backporting as determined when the 9u project comes into existence. If desired a 9.1 backport can be explicitly created to flag the intention/desire/request to get something into 9u.
01-06-2016

How do you decide what bugs to be fixed in JDK 10 vs JDK 9 vs update release?
31-05-2016