blob: 4da75810043cadb028c2d3c9faff417446163172 [file] [log] [blame]
J. Duke319a3b92007-12-01 00:00:00 +00001.'" t
2."
3." Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved.
4." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5."
6." This code is free software; you can redistribute it and/or modify it
7." under the terms of the GNU General Public License version 2 only, as
8." published by the Free Software Foundation.
9."
10." This code is distributed in the hope that it will be useful, but WITHOUT
11." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
13." version 2 for more details (a copy is included in the LICENSE file that
14." accompanied this code).
15."
16." You should have received a copy of the GNU General Public License version
17." 2 along with this work; if not, write to the Free Software Foundation,
18." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
19."
20." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
21." CA 95054 USA or visit www.sun.com if you need additional information or
22." have any questions.
23."
24." `
25.TH jps 1 "06 Aug 2006"
26." Generated by html2man
27
28.LP
29.SH NAME
30jps \- Java Virtual Machine Process Status Tool
31.LP
32.SH "SYNOPSIS"
33.LP
34
35.LP
36.nf
37\f3
38.fl
39\fP\f3jps\fP [ \f2options\fP ] [ \f2hostid\fP ]
40.br
41
42.fl
43.fi
44
45.LP
46.SH "PARAMETERS"
47.LP
48
49.LP
50.TP 3
51options
52Command\-line options.
53.TP 3
54hostid
55The host identifier of the host for which the process report should be generated. The \f2hostid\fP may include optional components that indicate the communications protocol, port number, and other implementation specific data.
56.LP
57.SH "DESCRIPTION"
58.LP
59
60.LP
61.LP
62The \f3jps\fP tool lists the instrumented HotSpot Java Virtual Machines (JVMs) on the target system. The tool is limited to reporting information on JVMs for which it has the access permissions.
63.LP
64.LP
65If \f3jps\fP is run without specifying a \f2hostid\fP, it will look for instrumented JVMs on the local host. If started with a \f2hostid\fP, it will look for JVMs on the indicated host, using the specified protocol and port. A \f3jstatd\fP process is assumed to be running on the target host.
66.LP
67.LP
68The \f3jps\fP command will report the local VM identifier, or \f2lvmid\fP, for each instrumented JVM found on the target system. The \f3lvmid\fP is typically, but not necessarily, the operating system's process identifier for the JVM process. With no options, \f3jps\fP will list each Java application's \f2lvmid\fP followed by the short form of the application's class name or jar file name. The short form of the class name or JAR file name omits the class's package information or the JAR files path information.
69.LP
70.LP
71The \f3jps\fP command uses the \f3java\fP launcher to find the class name and arguments passed to the \f2main\fP method. If the target JVM is started with a custom launcher, the class name (or JAR file name) and the arguments to the \f2main\fP method will not be available. In this case, the \f3jps\fP command will output the string \f2Unknown\fP for the class name or JAR file name and for the arguments to the main method.
72.LP
73.LP
74The list of JVMs produced by the \f3jps\fP command may be limited by the permissions granted to the principal running the command. The command will only list the JVMs for which the principle has access rights as determined by operating system specific access control mechanisms.
75.LP
76.LP
77\f3NOTE:\fP This utility is unsupported and may not be available in future versions of the JDK. It is not currently available on Windows 98 and Windows ME platforms.
78.LP
79.SH "OPTIONS"
80.LP
81
82.LP
83.LP
84The \f3jps\fP command supports a number of options that modify the output of the command. These options are subject to change or removal in the future.
85.LP
86.TP 3
87\-q
88Suppress the output of the class name, JAR file name, and arguments passed to the \f2main\fP method, producing only a list of local VM identifiers.
89.TP 3
90\-m
91Output the arguments passed to the main method. The output may be null for embedded JVMs.
92.TP 3
93\-l
94Output the full package name for the application's main class or the full path name to the application's JAR file.
95.TP 3
96\-v
97Output the arguments passed to the JVM.
98.TP 3
99\-V
100Output the arguments passed to the JVM through the flags file (the .hotspotrc file or the file specified by the \-XX:Flags=<\f2filename\fP> argument).
101.TP 3
102\-Joption
103Pass \f2option\fP to the \f3java\fP launcher called by \f3jps\fP. For example, \f3\-J\-Xms48m\fP sets the startup memory to 48 megabytes. It is a common convention for \f3\-J\fP to pass options to the underlying VM executing applications written in Java.
104.LP
105.SS
106HOST IDENTIFIER
107.LP
108.RS 3
109
110.LP
111.LP
112The host identifier, or \f2hostid\fP is a string that indicates the target system. The syntax of the \f2hostid\fP string largely corresponds to the syntax of a URI:
113.LP
114.nf
115\f3
116.fl
117[\fP\f4protocol\fP\f3:][[//]\fP\f4hostname\fP\f3][:\fP\f4port\fP\f3][/\fP\f4servername\fP\f3]\fP
118.br
119\f3
120.fl
121\fP
122.fi
123
124.LP
125.TP 3
126protocol
127The communications protocol. If the \f2protocol\fP is omitted and a \f2hostname\fP is not specified, the default protocol is a platform specific, optimized, local protocol. If the \f2protocol\fP is omitted and a \f2hostname\fP is specified, then the default protocol is \f3rmi\fP.
128.TP 3
129hostname
130A hostname or IP address indicating the target host. If \f2hostname\fP is omitted, then the target host is the local host.
131.TP 3
132port
133The default port for communicating with the remote server. If the \f2hostname\fP is omitted or the \f2protocol\fP specifies an optimized, local protocol, then \f2port\fP is ignored. Otherwise, treatment of the \f2port\fP parameter is implementation specific. For the default \f3rmi\fP protocol the \f2port\fP indicates the port number for the rmiregistry on the remote host. If \f2port\fP is omitted, and \f2protocol\fP indicates \f3rmi\fP, then the default rmiregistry port (1099) is used.
134.TP 3
135servername
136The treatment of this parameter depends on the implementation. For the optimized, local protocol, this field is ignored. For the \f3rmi\fP protocol, this parameter is a string representing the name of the RMI remote object on the remote host. See the \f3\-n\fP option for the \f3jstatd\fP command.
137.LP
138.RE
139.SH "OUTPUT FORMAT"
140.LP
141
142.LP
143.LP
144The output of the \f3jps\fP command follows the following pattern:
145.LP
146.nf
147\f3
148.fl
149\fP\f4lvmid\fP\f3 [ [ \fP\f4classname\fP\f3 | \fP\f4JARfilename\fP\f3 | "Unknown"] [ \fP\f4arg\fP\f3* ] [ \fP\f4jvmarg\fP\f3* ] ]\fP
150.br
151\f3
152.fl
153\fP
154.fi
155
156.LP
157.LP
158Where all output tokens are separated by white space. An \f2arg\fP that includes embedded white space will introduce ambiguity when attempting to map arguments to their actual positional parameters.
159.br
160.br
161\f3NOTE\fP: You are advised not to write scripts to parse \f3jps\fP output since the format may change in future releases. If you choose to write scripts that parse \f3jps\fP output, expect to modify them for future releases of this tool.
162.br
163
164.LP
165.SH "EXAMPLES"
166.LP
167
168.LP
169.LP
170This section provides examples of the \f3jps\fP command.
171.LP
172.LP
173Listing the instrumented JVMs on the local host:
174.LP
175.nf
176\f3
177.fl
178\fP\f3jps\fP
179.br
180
181.fl
18218027 Java2Demo.JAR
183.br
184
185.fl
18618032 jps
187.br
188
189.fl
19018005 jstat
191.br
192
193.fl
194.fi
195
196.LP
197.LP
198Listing the instrumented JVMs on a remote host:
199.LP
200.LP
201This example assumes that the \f3jstat\fP server and either the its internal RMI registry or a separate external \f3rmiregistry\fP process are running on the remote host on the default port (port 1099). It also assumes that the local host has appropriate permissions to access the remote host. This example also includes the \f2\-l\fP option to output the long form of the class names or JAR file names.
202.LP
203.nf
204\f3
205.fl
206\fP\f3jps \-l remote.domain\fP
207.br
208
209.fl
2103002 /opt/j2sdk1.5.0/demo/jfc/Java2D/Java2Demo.JAR
211.br
212
213.fl
2142857 sun.tools.jstatd.jstatd
215.br
216
217.fl
218.fi
219
220.LP
221.LP
222Listing the instrumented JVMs on a remote host with a non\-default port for the RMI registry
223.LP
224.LP
225This example assumes that the \f3jstatd\fP server, with an internal RMI registry bound to port 2002, is running on the remote host. This example also uses the \f2\-m\fP option to include the arguments passed to the \f2main\fP method of each of the listed Java applications.
226.LP
227.nf
228\f3
229.fl
230\fP\f3jps \-m remote.domain:2002\fP
231.br
232
233.fl
2343002 /opt/j2sdk1.5.0/demo/jfc/Java2D/Java2Demo.JAR
235.br
236
237.fl
2383102 sun.tools.jstatd.jstatd \-p 2002
239.fl
240.fi
241
242.LP
243.SH "SEE ALSO"
244.LP
245.RS 3
246.TP 2
247o
248java \- the Java Application Launcher
249.TP 2
250o
251jstat \- the Java virtual machine Statistics Monitoring Tool
252.TP 2
253o
254jstatd \- the jstat daemon
255.TP 2
256o
257rmiregistry \- the Java Remote Object Registry
258.RE
259
260.LP
261
262.LP
263