1jps(1)                      General Commands Manual                     jps(1)
2
3
4

Name

6       jps - Java Virtual Machine Process Status Tool
7

SYNOPSIS

9       jps [ options ] [ hostid ]
10
11
12

PARAMETERS

14          options
15             Command-line options.
16
17          hostid
18             The  host  identifier  of  the  host for which the process report
19             should be generated. The hostid may include  optional  components
20             that indicate the communications protocol, port number, and other
21             implementation specific data.
22
23

DESCRIPTION

25       The jps tool lists  the  instrumented  HotSpot  Java  Virtual  Machines
26       (JVMs)  on the target system. The tool is limited to reporting informa‐
27       tion on JVMs for which it has the access permissions.
28
29       If jps is run without specifying a hostid, it  will  look  for  instru‐
30       mented  JVMs  on the local host. If started with a hostid, it will look
31       for JVMs on the indicated host, using the specified protocol and  port.
32       A jstatd process is assumed to be running on the target host.
33
34       The jps command will report the local VM identifier, or lvmid, for each
35       instrumented JVM found on the target system. The  lvmid  is  typically,
36       but  not necessarily, the operating system's process identifier for the
37       JVM process. With no options, jps will  list  each  Java  application's
38       lvmid followed by the short form of the application's class name or jar
39       file name. The short form of the class name or JAR file name omits  the
40       class's package information or the JAR files path information.
41
42       The jps command uses the java launcher to find the class name and argu‐
43       ments passed to the main method. If the target JVM is  started  with  a
44       custom launcher, the class name (or JAR file name) and the arguments to
45       the main method will not be available. In this case,  the  jps  command
46       will  output the string Unknown for the class name or JAR file name and
47       for the arguments to the main method.
48
49       The list of JVMs produced by the jps command may be limited by the per‐
50       missions granted to the principal running the command. The command will
51       only list the JVMs for which the principle has access rights as  deter‐
52       mined by operating system specific access control mechanisms.
53
54       NOTE:  This  utility  is unsupported and may not be available in future
55       versions of the JDK. It is not currently available on  Windows  98  and
56       Windows ME platforms.
57

OPTIONS

59       The  jps command supports a number of options that modify the output of
60       the command. These options are subject to  change  or  removal  in  the
61       future.
62
63          -q Suppress  the  output of the class name, JAR file name, and argu‐
64             ments passed to the main method, producing only a list  of  local
65             VM identifiers.
66
67          -m Output the arguments passed to the main method. The output may be
68             null for embedded JVMs.
69
70          -l Output the full package name for the application's main class  or
71             the full path name to the application's JAR file.
72
73          -v Output the arguments passed to the JVM.
74
75          -V Output  the  arguments  passed  to the JVM through the flags file
76             (the   .hotspotrc   file   or   the   file   specified   by   the
77             -XX:Flags=<filename> argument).
78
79          -Joption
80             Pass  option  to  the  java  launcher called by jps. For example,
81             -J-Xms48m sets the startup memory to 48 megabytes. It is a common
82             convention  for -J to pass options to the underlying VM executing
83             applications written in Java.
84
85
86   HOST IDENTIFIER
87       The host identifier, or hostid is a string that  indicates  the  target
88       system. The syntax of the hostid string largely corresponds to the syn‐
89       tax of a URI:
90
91       [protocol:][[//]hostname][:port][/servername]
92
93
94          protocol
95             The communications protocol. If the protocol  is  omitted  and  a
96             hostname  is  not  specified,  the default protocol is a platform
97             specific, optimized, local protocol. If the protocol  is  omitted
98             and a hostname is specified, then the default protocol is rmi.
99
100          hostname
101             A  hostname or IP address indicating the target host. If hostname
102             is omitted, then the target host is the local host.
103
104          port
105             The default port for communicating with the remote server. If the
106             hostname is omitted or the protocol specifies an optimized, local
107             protocol, then port is ignored. Otherwise, treatment of the  port
108             parameter  is implementation specific. For the default rmi proto‐
109             col the port indicates the port number for the rmiregistry on the
110             remote host. If port is omitted, and protocol indicates rmi, then
111             the default rmiregistry port (1099) is used.
112
113          servername
114             The treatment of this parameter depends  on  the  implementation.
115             For the optimized, local protocol, this field is ignored. For the
116             rmi protocol, this parameter is a string representing the name of
117             the  RMI  remote object on the remote host. See the -n option for
118             the jstatd(1) command.
119
120

OUTPUT FORMAT

122       The output of the jps command follows the following pattern:
123
124       lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]
125
126
127       Where all output tokens are separated  by  white  space.  An  arg  that
128       includes  embedded white space will introduce ambiguity when attempting
129       to map arguments to their actual positional parameters.
130       NOTE: You are advised not to write scripts to parse  jps  output  since
131       the  format  may  change  in  future  releases.  If you choose to write
132       scripts that parse  jps  output,  expect  to  modify  them  for  future
133       releases of this tool.
134
135

EXAMPLES

137       This section provides examples of the jps command.
138
139       Listing the instrumented JVMs on the local host:
140
141       jps
142
143       18027 Java2Demo.JAR
144
145       18032 jps
146
147       18005 jstat
148
149
150
151       Listing the instrumented JVMs on a remote host:
152
153       This  example assumes that the jstat server and either the its internal
154       RMI registry or a separate external rmiregistry process are running  on
155       the  remote  host on the default port (port 1099). It also assumes that
156       the local host has appropriate permissions to access the  remote  host.
157       This example also includes the -l option to output the long form of the
158       class names or JAR file names.
159
160       jps -l remote.domain
161
162       3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
163
164       2857 sun.tools.jstatd.jstatd
165
166
167
168       Listing the instrumented JVMs on a remote host with a non-default  port
169       for the RMI registry
170
171       This  example assumes that the jstatd server, with an internal RMI reg‐
172       istry bound to port 2002, is running on the remote host.  This  example
173       also  uses  the  -m  option to include the arguments passed to the main
174       method of each of the listed Java applications.
175
176       jps -m remote.domain:2002
177
178       3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
179
180       3102 sun.tools.jstatd.jstatd -p 2002
181
182

SEE ALSO

184          o java(1) - the Java Application Launcher
185
186          o jstat(1) - the Java virtual machine Statistics Monitoring Tool
187
188          o jstatd(1) - the jstat daemon
189
190          o rmiregistry(1) - the Java Remote Object Registry
191
192
193                                  16 Mar 2012                           jps(1)
Impressum