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 should
19          be generated. The hostid may include optional components that  indi‐
20          cate the communications protocol, port number, and other implementa‐
21          tion specific data.
22

DESCRIPTION

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

OPTIONS

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

OUTPUT FORMAT

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

EXAMPLES

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

SEE ALSO

181          o java - the Java Application Launcher
182
183          o jstat - the Java virtual machine Statistics Monitoring Tool
184
185          o jstatd - the jstat daemon
186
187          o rmiregistry - the Java Remote Object Registry
188
189
190                                  06 Aug 2006                           jps(1)
Impressum