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.
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.
Example:
> 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 jcmd.
See also the jcmd Utility