I'm learning how to use jps, and I find this page: jps. It says that:
The lvmid is typically, but not necessarily, the operating system's process identifier for the JVM process.
So I'm wondering in what situation jps is not the operating system's process identifier?
Anyone would help?
The jps command uses the Java launcher to find the class name and arguments passed to the main method. If the target JVM is started with a custom launcher, then the class or JAR file name, and the arguments to the main method aren't available.
You can run the jps command (from the bin folder of JDK if it is not in your path) to find out what java processes (JVMs) are running on your machine.
ie: kill jps|grep "Server" | cut -d " " -f 1 , there are multiple server processes running and this command does kills all the processes but it takes a while.
Do all operating systems have the notion of a "process ID"? Maybe not. Some of them may even represent process IDs, not as Integers, but in an entirely different form. Process IDs are a platform specific concept and could change in the future. Java is designed to be platform-independent. This is why it may not always work.
However, on all major operating systems currently in use today, the lvmid
should always return the operating system's process ID for the JVM process.
It's basically saying that the lvmid is typically the same as the O/S pid (process id), but that it doesn't have to be the same. Some operating systems might differentiate between them (I don't know which ones).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With