Revision: 42233
Initial Code
Initial URL
Initial Description
Initial Title
Initial Tags
Initial Language
at March 2, 2011 03:34 by cruelfate
Initial Code
String pid = ManagementFactory.getRuntimeMXBean().getName(); log.info("Foo started: pid = " + pid);
Initial URL
Initial Description
This is especially useful to have appear in logs. While it is totally up to the JVM implementation what to return for the name, most seem to return a numeric process identifier.
Initial Title
PID of Java Process From Same Process Without Using Exec
Initial Tags
java
Initial Language
Java