5

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.

danieln
  • 4,795
  • 10
  • 42
  • 64

2 Answers2

3

The jps command can be used:

jps -l | grep pid

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

M A
  • 71,713
  • 13
  • 134
  • 174
  • It worked for some of the processes but may still shows `-- process information unavailable`. Any idea why? – Thomas Jun 02 '15 at 11:43
  • that is another question: http://stackoverflow.com/questions/5271907/jps-process-information-unavailable-jconsole-and-jvisualvm-not-working – Jayan Jun 02 '15 at 11:48
1

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

Bhargav Modi
  • 2,605
  • 3
  • 29
  • 49