5865
|
1 |
." Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
|
2
|
2 |
." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3 |
."
|
|
4 |
." This code is free software; you can redistribute it and/or modify it
|
|
5 |
." under the terms of the GNU General Public License version 2 only, as
|
|
6 |
." published by the Free Software Foundation.
|
|
7 |
."
|
|
8 |
." This code is distributed in the hope that it will be useful, but WITHOUT
|
|
9 |
." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
10 |
." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
11 |
." version 2 for more details (a copy is included in the LICENSE file that
|
|
12 |
." accompanied this code).
|
|
13 |
."
|
|
14 |
." You should have received a copy of the GNU General Public License version
|
|
15 |
." 2 along with this work; if not, write to the Free Software Foundation,
|
|
16 |
." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
17 |
."
|
5506
|
18 |
." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
19 |
." or visit www.oracle.com if you need additional information or have any
|
|
20 |
." questions.
|
2692
|
21 |
."
|
5865
|
22 |
.TH jps 1 "02 Jun 2010"
|
2
|
23 |
|
|
24 |
.LP
|
2692
|
25 |
.SH "Name"
|
2
|
26 |
jps \- Java Virtual Machine Process Status Tool
|
|
27 |
.LP
|
|
28 |
.SH "SYNOPSIS"
|
|
29 |
.LP
|
|
30 |
|
|
31 |
.LP
|
|
32 |
.nf
|
|
33 |
\f3
|
|
34 |
.fl
|
|
35 |
\fP\f3jps\fP [ \f2options\fP ] [ \f2hostid\fP ]
|
|
36 |
.br
|
|
37 |
|
|
38 |
.fl
|
|
39 |
.fi
|
|
40 |
|
|
41 |
.LP
|
|
42 |
.SH "PARAMETERS"
|
|
43 |
.LP
|
|
44 |
|
|
45 |
.LP
|
2692
|
46 |
.RS 3
|
2
|
47 |
.TP 3
|
|
48 |
options
|
|
49 |
Command\-line options.
|
|
50 |
.TP 3
|
|
51 |
hostid
|
|
52 |
The 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.
|
2692
|
53 |
.RE
|
|
54 |
|
2
|
55 |
.LP
|
|
56 |
.SH "DESCRIPTION"
|
|
57 |
.LP
|
|
58 |
|
|
59 |
.LP
|
|
60 |
.LP
|
|
61 |
The \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.
|
|
62 |
.LP
|
|
63 |
.LP
|
|
64 |
If \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.
|
|
65 |
.LP
|
|
66 |
.LP
|
|
67 |
The \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.
|
|
68 |
.LP
|
|
69 |
.LP
|
|
70 |
The \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.
|
|
71 |
.LP
|
|
72 |
.LP
|
|
73 |
The 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.
|
|
74 |
.LP
|
|
75 |
.LP
|
|
76 |
\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.
|
|
77 |
.LP
|
|
78 |
.SH "OPTIONS"
|
|
79 |
.LP
|
|
80 |
|
|
81 |
.LP
|
|
82 |
.LP
|
|
83 |
The \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.
|
|
84 |
.LP
|
2692
|
85 |
.RS 3
|
2
|
86 |
.TP 3
|
|
87 |
\-q
|
|
88 |
Suppress 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
|
|
91 |
Output the arguments passed to the main method. The output may be null for embedded JVMs.
|
|
92 |
.TP 3
|
|
93 |
\-l
|
|
94 |
Output 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
|
|
97 |
Output the arguments passed to the JVM.
|
|
98 |
.TP 3
|
|
99 |
\-V
|
|
100 |
Output 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
|
|
103 |
Pass \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.
|
2692
|
104 |
.RE
|
|
105 |
|
2
|
106 |
.LP
|
|
107 |
.SS
|
|
108 |
HOST IDENTIFIER
|
|
109 |
.LP
|
|
110 |
.RS 3
|
|
111 |
|
|
112 |
.LP
|
|
113 |
.LP
|
|
114 |
The 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:
|
|
115 |
.LP
|
|
116 |
.nf
|
|
117 |
\f3
|
|
118 |
.fl
|
|
119 |
[\fP\f4protocol\fP\f3:][[//]\fP\f4hostname\fP\f3][:\fP\f4port\fP\f3][/\fP\f4servername\fP\f3]\fP
|
|
120 |
.br
|
|
121 |
\f3
|
|
122 |
.fl
|
|
123 |
\fP
|
|
124 |
.fi
|
|
125 |
|
|
126 |
.LP
|
2692
|
127 |
.RS 3
|
2
|
128 |
.TP 3
|
|
129 |
protocol
|
|
130 |
The 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.
|
|
131 |
.TP 3
|
|
132 |
hostname
|
|
133 |
A hostname or IP address indicating the target host. If \f2hostname\fP is omitted, then the target host is the local host.
|
|
134 |
.TP 3
|
|
135 |
port
|
|
136 |
The 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.
|
|
137 |
.TP 3
|
|
138 |
servername
|
2692
|
139 |
The 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 jstatd(1) command.
|
|
140 |
.RE
|
|
141 |
|
2
|
142 |
.LP
|
|
143 |
.RE
|
|
144 |
.SH "OUTPUT FORMAT"
|
|
145 |
.LP
|
|
146 |
|
|
147 |
.LP
|
|
148 |
.LP
|
|
149 |
The output of the \f3jps\fP command follows the following pattern:
|
|
150 |
.LP
|
|
151 |
.nf
|
|
152 |
\f3
|
|
153 |
.fl
|
|
154 |
\fP\f4lvmid\fP\f3 [ [ \fP\f4classname\fP\f3 | \fP\f4JARfilename\fP\f3 | "Unknown"] [ \fP\f4arg\fP\f3* ] [ \fP\f4jvmarg\fP\f3* ] ]\fP
|
|
155 |
.br
|
|
156 |
\f3
|
|
157 |
.fl
|
|
158 |
\fP
|
|
159 |
.fi
|
|
160 |
|
|
161 |
.LP
|
|
162 |
.LP
|
|
163 |
Where 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.
|
|
164 |
.br
|
|
165 |
.br
|
|
166 |
\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.
|
|
167 |
.br
|
|
168 |
|
|
169 |
.LP
|
|
170 |
.SH "EXAMPLES"
|
|
171 |
.LP
|
|
172 |
|
|
173 |
.LP
|
|
174 |
.LP
|
|
175 |
This section provides examples of the \f3jps\fP command.
|
|
176 |
.LP
|
|
177 |
.LP
|
|
178 |
Listing the instrumented JVMs on the local host:
|
|
179 |
.LP
|
|
180 |
.nf
|
|
181 |
\f3
|
|
182 |
.fl
|
|
183 |
\fP\f3jps\fP
|
|
184 |
.br
|
|
185 |
|
|
186 |
.fl
|
|
187 |
18027 Java2Demo.JAR
|
|
188 |
.br
|
|
189 |
|
|
190 |
.fl
|
|
191 |
18032 jps
|
|
192 |
.br
|
|
193 |
|
|
194 |
.fl
|
|
195 |
18005 jstat
|
|
196 |
.br
|
|
197 |
|
|
198 |
.fl
|
|
199 |
.fi
|
|
200 |
|
|
201 |
.LP
|
|
202 |
.LP
|
|
203 |
Listing the instrumented JVMs on a remote host:
|
|
204 |
.LP
|
|
205 |
.LP
|
|
206 |
This 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.
|
|
207 |
.LP
|
|
208 |
.nf
|
|
209 |
\f3
|
|
210 |
.fl
|
|
211 |
\fP\f3jps \-l remote.domain\fP
|
|
212 |
.br
|
|
213 |
|
|
214 |
.fl
|
2692
|
215 |
3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
|
2
|
216 |
.br
|
|
217 |
|
|
218 |
.fl
|
|
219 |
2857 sun.tools.jstatd.jstatd
|
|
220 |
.br
|
|
221 |
|
|
222 |
.fl
|
|
223 |
.fi
|
|
224 |
|
|
225 |
.LP
|
|
226 |
.LP
|
|
227 |
Listing the instrumented JVMs on a remote host with a non\-default port for the RMI registry
|
|
228 |
.LP
|
|
229 |
.LP
|
|
230 |
This 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.
|
|
231 |
.LP
|
|
232 |
.nf
|
|
233 |
\f3
|
|
234 |
.fl
|
|
235 |
\fP\f3jps \-m remote.domain:2002\fP
|
|
236 |
.br
|
|
237 |
|
|
238 |
.fl
|
2692
|
239 |
3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
|
2
|
240 |
.br
|
|
241 |
|
|
242 |
.fl
|
|
243 |
3102 sun.tools.jstatd.jstatd \-p 2002
|
|
244 |
.fl
|
|
245 |
.fi
|
|
246 |
|
|
247 |
.LP
|
|
248 |
.SH "SEE ALSO"
|
|
249 |
.LP
|
|
250 |
.RS 3
|
|
251 |
.TP 2
|
|
252 |
o
|
2692
|
253 |
java(1) \- the Java Application Launcher
|
2
|
254 |
.TP 2
|
|
255 |
o
|
2692
|
256 |
jstat(1) \- the Java virtual machine Statistics Monitoring Tool
|
2
|
257 |
.TP 2
|
|
258 |
o
|
2692
|
259 |
jstatd(1) \- the jstat daemon
|
2
|
260 |
.TP 2
|
|
261 |
o
|
2692
|
262 |
rmiregistry(1) \- the Java Remote Object Registry
|
2
|
263 |
.RE
|
|
264 |
|
|
265 |
.LP
|
|
266 |
|