Is there a way to to find the main class name of a running JVM using its PID?
This is something that is already done in jvisualvm, for example.
The jps
command can be used:
jps -l | grep pid
-l
prints the full class name. See this link for the official documentation.
you can use below command
jps -m or jps -l
jps - Java running processes
it will list down all the ``processes and its PID
running in OS