Summary
The launch of a process using Runtime.exec, ProcessBuilder.start, or ProcessBuilder.startPipeline descriptions clarify the system dependent environment inherited by the child. The minimum system dependent environment values of the parent may be overridden with appropriate values in the child.
Problem
The current description of Runtime.exec, ProcessBuilder.start, and ProcessBuilder.startPipeline identifies a minimum set of system dependent environment variables needed to launch a process and allows additional system dependent environment variables to be present in the child. However, it does not acknowledge that the parent's values of the minimum set of system dependent variables may not be appropriate for the child.
Solution
The description of the minimum set of system dependent environment variables is extended to allow the parent's values of those environment variables to be overridden in the child.
Specification
The javadoc of three methods is updated to add a description of the permitted override:
In java.lang.Runtime.exec(String[] cmdarray, String[] envp, File dir)...
:
* <p>A minimal set of system dependent environment variables may
* be required to start a process on some operating systems.
* As a result, the subprocess may inherit additional environment variable
* settings beyond those in the specified environment.
+ * The minimal set of system dependent environment variables
+ * may override the values provided in the environment.
In java.lang.ProcessBuilder.start()...
:
* <p>A minimal set of system dependent environment variables may
* be required to start a process on some operating systems.
* As a result, the subprocess may inherit additional environment variable
* settings beyond those in the process builder's {@link #environment()}.
+ * The minimal set of system dependent environment variables
+ * may override the values provided in the environment.
In java.lang.ProcessBuilder.startPipeline(List<ProcessBuilder> builders)...
:
* A minimal set of system dependent environment variables may
* be required to start a process on some operating systems.
* As a result, the subprocess may inherit additional environment variable
* settings beyond those in the process builder's {@link #environment()}.
+ * The minimal set of system dependent environment variables
+ * may override the values provided in the environment.
- csr of
-
JDK-8299034 Runtime::exec clarification of inherited environment
-
- Resolved
-