[preview] Adding java.lang.Runtime.getVMArguments() method

mark.reinhold at oracle.com mark.reinhold at oracle.com
Tue Nov 24 17:24:05 UTC 2015

2015/11/24 9:05 -0800, roger.riggs at oracle.com:
> The arguments may contain sensitive information so the method will need 
> a SecurityManager
> check and appropriate permission.

Yes, definitely.

>                                   The method name should be more 
> appropriate; the JRE is not just the VM.
> Perhaps commandArguments() or something that related to the process 
> command arguments as a whole.

I'd go simply with "arguments()", since the Runtime object is already a
representation of the run-time environment.

Does the value returned by this method include the command itself?  That
is, can one pass the result to an invocation of Runtime::exec or to a
ProcessBuilder in order to fork an identical process?

Should we care that the various Runtime::exec methods all operate on
strings or arrays, while this method returns a List<String>?  Or at this
point do we expect most people to use ProcessBuilder, which does take

(Hmm, is it time to deprecate the Runtime::exec methods?  Paging
 Dr. Deprecator ...)

- Mark

More information about the core-libs-dev mailing list