Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
/ jdk20 Public archive

Commit

Permalink
8299034: Runtime::exec clarification of inherited environment
Browse files Browse the repository at this point in the history
Reviewed-by: alanb
  • Loading branch information
Roger Riggs committed Jan 12, 2023
1 parent 752a370 commit 6a4a874
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/java.base/share/classes/java/lang/ProcessBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1004,6 +1004,8 @@ public ProcessBuilder redirectErrorStream(boolean redirectErrorStream) {
* 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.
*
* <p>If there is a security manager, its
* {@link SecurityManager#checkExec checkExec}
Expand Down Expand Up @@ -1181,6 +1183,8 @@ private Process start(Redirect[] redirects) throws IOException {
* 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.
* <p>
* If there is a security manager, its
* {@link SecurityManager#checkExec checkExec}
Expand Down
2 changes: 2 additions & 0 deletions src/java.base/share/classes/java/lang/Runtime.java
Original file line number Diff line number Diff line change
Expand Up @@ -569,6 +569,8 @@ public Process exec(String[] cmdarray, String[] envp) throws IOException {
* 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.
*
* <p>{@link ProcessBuilder#start()} is now the preferred way to
* start a process with a modified environment.
Expand Down

1 comment on commit 6a4a874

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.