Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get main class of a running JVM using PID

Tags:

java

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.

like image 385
danieln Avatar asked Sep 27 '22 18:09

danieln


1 Answers

The jps command can be used:

jps -l | grep pid

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

like image 162
M A Avatar answered Oct 31 '22 13:10

M A