Review request for 7034570 - java.lang.Runtime.exec(String[] cmd, String[] env) can not work properly if SystemRoot not inherited
Alan Bateman
Alan.Bateman at oracle.com
Fri Apr 15 13:18:41 UTC 2011
Ulf Zibis wrote:
>
>
> I don't think about silently changing, I think about to *disallow to
> set* it e.g. by the put() method, and instead retrieve it by default
> from constructor, so it could be always read by the get() method.
Ah, you mean the environment returned by ProcessBuilder where the spec
does allow the Map to forbid changing certain variables. I don't see
this working for the Runtime.exec case as we can't change these methods
to fail if the environment includes SystemRoot. The other case is where
the environment is initially cleared (in ProcessBuilder's class
description it has a note suggesting to use the clear method to start a
process with an explicit set of environment variables). All told, I
think Michael's approach to ensure that SystemRoot is in the child
environment is reasonable.
-Alan.
More information about the core-libs-dev
mailing list