Get the main class of a running JVM using PID

Is there a way to find the name of the main class running the JVM using the PID?

This is what has already been done in jvisualvm, for example.

+4
source share
2 answers

You can use the command jps:

jps -l | grep pid

-lprints the full class name. See this link for official documentation.

+3
source

you can use below command

jps -m or jps -l

jps - Java running processes

he will list all the "processes" and PIDrunning in the OS

+1
source

All Articles