Close

Java - jps Command

[Last Updated: May 20, 2018]

Java Tools & Commands Java 

jps is standard command-line utility which comes with JDK (starting from JDK 1.5).

jps is useful tools for viewing information about running java processes.

c:>jps -help
usage: jps [--help]
jps [-q] [-mlvV] [<hostid>]

Definitions:
<hostid>: <hostname>[:<port>]
-? -h --help -help: Print this help message and exit.

c:>java -version
java version "17.0.4.1" 2022-08-18 LTS
Java(TM) SE Runtime Environment (build 17.0.4.1+1-LTS-2)
Java HotSpot(TM) 64-Bit Server VM (build 17.0.4.1+1-LTS-2, mixed mode, sharing)


Examples:

Showing PID with java process name:

C:>jps
9088 Launcher
6644
10792 Jps
392 RemoteMavenServer
8824 Launcher
....


Showing process arguments passed to the main method.

c:>jps -m
6644
392 RemoteMavenServer
10972 Launcher clean install tomcat7:run-war -Dmode=rel
12540 Launcher /C:/Program Files (x86)/JetBrains/IntelliJ IDEA .....


Showing the full package name for the application's main class or the full path name to the application's JAR file.

c:>jps -l
11872 sun.tools.jps.Jps
6644
392 org.jetbrains.idea.maven.server.RemoteMavenServer
10972 org.codehaus.plexus.classworlds.launcher.Launcher
....


Showing only process id

c:>jps -q
2212
6644
392
5016
....


Showing the JVM options passed to the process:

c:>jps -v
2212 Launcher -agentlib:jdwp=transport=dt_socket,address=8000,server=y,suspend=n -Dclassworlds.conf=D:\apache-maven-3.0.4\bin\m2.conf -Dmaven.home=D:\apache-maven-3.0.4
6644 -Xms128m -Xmx750m -XX:MaxPermSize=350m -XX:ReservedCodeCacheSize=240m -XX:+UseConcMarkSweepGC -XX:SoftRefLRUPolicyMSPerMB=50 -ea -Dsun.io.useCanonCaches=false -Djava.net.preferIPv4Stack=true -XX:+HeapDumpOnOutOfMemoryError -XX:-OmitStackTraceInFastThrow -Djb.vmOptionsFile=C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 15.0.2\bin\idea64.exe.vmoptions -Xbootclasspath/a:C:\Program Files (x86)\JetBrains\IntelliJ IDEA Community Edition 15.0.2\lib\boot.jar -Didea.paths.selector=IdeaIC15
.....

Showing process id and process name only:

c:>jps -V
3632 Launcher
1668 Launcher
6644
7724 Jps



See Also