maxxedev commented on PR #1322:
URL: https://github.com/apache/commons-lang/pull/1322#issuecomment-2508890675
@ppkarwasz
> JVM will never have PID 1
JVM can certainly be PID 1 inside a container. Example:
```
$ cat App.java
public class App {
public static void main(String... args) {
var mxBean =
java.lang.management.ManagementFactory.getRuntimeMXBean();
System.out.println(mxBean.getName());
}
}
$ docker run -it --entrypoint java -v `pwd`:/tmp/ openjdk:21 /tmp/App.java
1@afecfa5e25bb
```
> checking `/proc/1/environ` and the environment of the JVM is equivalent.
Yes, equivalent but perhaps reading from `System.getenv()` is a slight
improvement by avoiding file i/o on procfs
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]