How do I get the id of my Java process?
I know there are several platform-dependent hacks, but I would prefer a more generic solution.
The latest I have found is that there is a system property called sun.java.launcher.pid that is available at least on linux. My plan is to use that and if it is not found to use the JMX bean.
sun.java.launcher.pid
JMX bean