jps
List Java Virtual Machine process information
TLDR
List all JVM processes
List all JVM processes with only PID
Display the arguments passed to the processes
Display the full package name of all processes
Display the arguments passed to the JVM
SYNOPSIS
jps [ options ] [ hostid ]
PARAMETERS
-q
Suppresses the class name, JAR file name, and arguments passed to the main method output, producing only the local VM identifier.
This can simplify output for scripting or automation.
-m
Outputs the arguments passed to the main method of the application.
-l
Outputs the fully qualified class name of the application's main class or the full path name to the application's JAR file.
Useful when the application name is ambiguous.
-v
Outputs the JVM arguments passed to the JVM, including system properties.
-V
Outputs arguments passed to the JVM through the flag file (typically java.options file).
-J
Passes
DESCRIPTION
The jps command is a utility included with the Java Development Kit (JDK) that provides information about the Java Virtual Machines (JVMs) running on a target system. It lists the processes along with their Java application names or, if the application name is unavailable, the main class name. This allows developers and administrators to easily identify and monitor Java processes, diagnose issues, and understand the execution status of Java applications.
jps connects to each JVM using the HotSpot internal API and reads the process data. Because of this functionality, it's very useful for getting a basic overview of currently running java processes.
CAVEATS
The jps tool relies on the ability to connect to the target JVMs using internal APIs. If a JVM is not configured to allow such connections (e.g., due to security restrictions or firewall settings), jps may not be able to detect it. It can also produce misleading output if the application is actively using the internal API.
OUTPUT INTERPRETATION
The output of jps consists of a list of VMIDs (Virtual Machine IDs) and their associated application names or class names. The VMID is a unique identifier for each JVM instance. Note that a missing application name typically indicates that the JVM was launched without setting the proper application name.
TROUBLESHOOTING
If jps fails to list a JVM, check firewall settings, user permissions, and the JVM's configuration. The 'java.rmi.server.hostname' property can sometimes interfere with jps's ability to discover processes. Ensure the JAVA_HOME environment variable is set correctly.
HISTORY
The jps command has been a part of the JDK since the early days of Java. It was designed as a simple tool for identifying running Java processes. Over time, its capabilities have been extended to provide more detailed information about these processes, reflecting the evolution of the Java platform and its management tools.