List of Java processes
How can I list all Java processes in bash?
I need an command line. I know there is command
ps but I don't know what parameters I need to use.
ps aux | grep java
and see how you get on
Read more... Read less...
Recent Java comes with Java Virtual Machine Process Status Tool "jps"
[[email protected] support]$ jps -m 2120 Main --userdir /home/nsushkin/.netbeans/7.0 --branding nb 26546 charles.jar 17600 Jps -m
is most useful. Prints just pid and qualified main class name:
2472 com.intellij.idea.Main 11111 sun.tools.jps.Jps 9030 play.server.Server 2752 org.jetbrains.idea.maven.server.RemoteMavenServer
Starting from Java 7, the simplest way and less error prone is to simply use the command
jcmd that is part of the JDK such that it will work the same way on all OS.
> jcmd 5485 sun.tools.jcmd.JCmd 2125 MyProgram
jcmdallows to send diagnostic command requests to a running Java Virtual Machine (JVM).
More details about how to use
See also the
For better output format check this command:
ps -fC java