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
Quiet mode: outputs only the process ID (PID) for each JVM
-m
Outputs arguments passed to the main method (null for embedded JVMs)
-l
Long format: full package name or JAR path for main class
-v
Outputs JVM arguments passed to the running process (local only)
-V
Outputs the JVM version for each process
-Joption
Passes option to the JVM launcher (e.g., -J-Xmx512m)
DESCRIPTION
The jps command, short for Java Virtual Machine Process Status, is a tool included in the JDK bin directory that lists the instrumented HotSpot Java Virtual Machines (JVMs) on the target system. It displays the process ID (PID) and the main class for each Java application or daemon running.
Primarily used for monitoring and debugging Java applications, jps leverages the JVM Attachment API to query running JVMs without requiring prior instrumentation. It identifies JVMs by attaching to processes that respond to the attach mechanism, making it invaluable for finding PIDs needed by tools like jstat, jmap, or jstack.
By default, it outputs two columns: PID and the short name of the main class. Options allow customization, such as showing only PIDs, VM arguments, or full paths. Note that it works best on local systems and requires matching JDK architecture (32/64-bit). It may miss non-HotSpot JVMs or those without attach support.
CAVEATS
Only detects HotSpot JVMs with attach mechanism support; may fail on remote hosts without RMI setup or mismatched JDK versions/architectures. Not suitable for non-Java processes or embedded/minimal JVMs.
HOSTID FORMAT
Optional hostid specifies target: [hostname]:[port] for remote JVMs via RMI registry; omit for local system.
DEFAULT OUTPUT
Example:
1234 HelloWorld
5678 org.example.App
HISTORY
Introduced in JDK 5.0 (2004) as part of JVM monitoring tools, enhanced in later JDKs for better attach API integration and remote support via RMI.


