jps - JVM Process Status Tool

In this article we are going to elaborate the jps command tool which is a part of JAVA commands (comes with jdk package). This article is the continuation of this previous article.

As we know the standard format of commands in java, the jps command also have the format(in command prompt)
jps [options] [hostid]

In here, hostid is a host identifier for which the process report will be generated.
The jps lists the instrumented JVM and reports(permitted info).
-If no hostid, it looks JVMs at local host.
-If started with a hostid, it looks JVMs on the specific host(with a protocol and port). A jstatd process is assumed to be running on the target host.(I will make a separate post for jstatd)

The jps reports the local VM (or lvmid, typically, but always, system's process identifier). If no option, jps lists each Java application's lvmid followed by the short form of the application's class name or jar file name. jps shows string Unknown for the class name /JAR name and for arguments to the main method when custom launcher. jps command may be limited by the permissions

jps options :
-q : Shows list of local VM identifiers(Suppress class name/JAR name/Main method arguments)
-m : Output the Main Method arguments
-l : Shows full package name for main class or full path of JAR file.
-v : Shows arguments passed to the JVM.
-V : Shows arguments passed to the JVM through the flags file (.hotspotrc or by the -XX:Flags=[filename]).
-J[option] : Pass option to the java launcher.

-The host id is same as VMI(shown in below of  jstat tool)
-jps provides output in following format
lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]


No comments:

Post a Comment