How to get process id of a Java application?
The code below show you how to get the process id of a Java application. We can use the
ManagementFactory.getRuntimeMXBean().getName() to get the process id. In Windows the method return a string in the form of
Here is the result of the code above:
Name = 8564@AURORA
PID = 8564