Details
-
New Feature
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
Sometime we need to know what process id of our running java program, e.g.
① shutdown java program via a shell script, e.g. kill -15 <pid>
② attach the current JVM to transform loaded classes on the fly, e.g. VirtualMachine.attach("<pid>");
Runtime.getRuntime().getPid() can help us to achieve the goal.