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]