-
Enhancement
-
Resolution: Unresolved
-
P4
-
None
-
None
-
generic
-
generic
ADDITIONAL SYSTEM INFORMATION :
N/A cross platform RGE
A DESCRIPTION OF THE PROBLEM :
https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/ProcessHandle.Info.html introduced in Java 9 provides cross platform ways of getting information about other processes on the system.
However the API offers no way to get a list of the environment variables of the process (either what was set at the process start or what it currently has if modified).
Some tools (e.g. the Jenkins CI server) use this information. e.g. for Jenkins in order to clean up processes after a build to prevent dangling processes whilst allowing some specific processes that have a given "cookie" set in the environment to remain running.
Currently (and since the early days of Jenkins) this has been performed by code that works cross platform on Linux/AIX (and unix like systems) as well as Windows hosts. (some of this code is native, and some works with the /proc file system)
This request is to expand ProcessHandle.Info to contain a method to return a (optional) Map<String,String> of a snapshot of the the given process's environment
N/A cross platform RGE
A DESCRIPTION OF THE PROBLEM :
https://docs.oracle.com/en/java/javase/22/docs/api/java.base/java/lang/ProcessHandle.Info.html introduced in Java 9 provides cross platform ways of getting information about other processes on the system.
However the API offers no way to get a list of the environment variables of the process (either what was set at the process start or what it currently has if modified).
Some tools (e.g. the Jenkins CI server) use this information. e.g. for Jenkins in order to clean up processes after a build to prevent dangling processes whilst allowing some specific processes that have a given "cookie" set in the environment to remain running.
Currently (and since the early days of Jenkins) this has been performed by code that works cross platform on Linux/AIX (and unix like systems) as well as Windows hosts. (some of this code is native, and some works with the /proc file system)
This request is to expand ProcessHandle.Info to contain a method to return a (optional) Map<String,String> of a snapshot of the the given process's environment