2.15 The jps Utility

The jps utility lists every instrumented Java HotSpot VM for the current user on the target system. The utility is very useful in environments where the VM is embedded, that is; where it is started using the JNI Invocation API rather than the java launcher. In these environments, it is not always easy to recognize the Java processes in the process list.

The utility lists the virtual machines for which the user has access rights. This is determined by access-control mechanisms specific to the operating system. On Oracle Solaris operating system, for example, if a non-root user executes the jps utility, then the output is a list of the virtual machines that were started with that user's uid.

In addition to listing the PID, the utility provides options to output the arguments passed to the application's main method, the complete list of VM arguments, and the full package name of the application's main class. The jps utility can also list processes on a remote system if the remote system is running the jstatd daemon.

If you are running several Java Web Start applications on a system, they tend to look the same, as shown in Example 2-27.

Example 2-27 Java Web Start Applications

$ jps
1271 jps
1269 Main
1190 Main

In this case, use jps -m to distinguish them, as shown in Example 2-28.