tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 1 | ." Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 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 | ." |
| 18 | ." Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, |
| 19 | ." CA 95054 USA or visit www.sun.com if you need additional information or |
| 20 | ." have any questions. |
| 21 | ." |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 22 | .TH jps 1 "04 May 2009" |
| 23 | ." Generated from HTML by html2man (author: Eric Armstrong) |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 24 | |
| 25 | .LP |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 26 | .SH "Name" |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 27 | jps \- Java Virtual Machine Process Status Tool |
| 28 | .LP |
| 29 | .SH "SYNOPSIS" |
| 30 | .LP |
| 31 | |
| 32 | .LP |
| 33 | .nf |
| 34 | \f3 |
| 35 | .fl |
| 36 | \fP\f3jps\fP [ \f2options\fP ] [ \f2hostid\fP ] |
| 37 | .br |
| 38 | |
| 39 | .fl |
| 40 | .fi |
| 41 | |
| 42 | .LP |
| 43 | .SH "PARAMETERS" |
| 44 | .LP |
| 45 | |
| 46 | .LP |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 47 | .RS 3 |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 48 | .TP 3 |
| 49 | options |
| 50 | Command\-line options. |
| 51 | .TP 3 |
| 52 | hostid |
| 53 | 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. |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 54 | .RE |
| 55 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 56 | .LP |
| 57 | .SH "DESCRIPTION" |
| 58 | .LP |
| 59 | |
| 60 | .LP |
| 61 | .LP |
| 62 | 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. |
| 63 | .LP |
| 64 | .LP |
| 65 | 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. |
| 66 | .LP |
| 67 | .LP |
| 68 | 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. |
| 69 | .LP |
| 70 | .LP |
| 71 | 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. |
| 72 | .LP |
| 73 | .LP |
| 74 | 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. |
| 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 |
| 84 | 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. |
| 85 | .LP |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 86 | .RS 3 |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 87 | .TP 3 |
| 88 | \-q |
| 89 | 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. |
| 90 | .TP 3 |
| 91 | \-m |
| 92 | Output the arguments passed to the main method. The output may be null for embedded JVMs. |
| 93 | .TP 3 |
| 94 | \-l |
| 95 | Output the full package name for the application's main class or the full path name to the application's JAR file. |
| 96 | .TP 3 |
| 97 | \-v |
| 98 | Output the arguments passed to the JVM. |
| 99 | .TP 3 |
| 100 | \-V |
| 101 | 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). |
| 102 | .TP 3 |
| 103 | \-Joption |
| 104 | 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. |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 105 | .RE |
| 106 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 107 | .LP |
| 108 | .SS |
| 109 | HOST IDENTIFIER |
| 110 | .LP |
| 111 | .RS 3 |
| 112 | |
| 113 | .LP |
| 114 | .LP |
| 115 | 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: |
| 116 | .LP |
| 117 | .nf |
| 118 | \f3 |
| 119 | .fl |
| 120 | [\fP\f4protocol\fP\f3:][[//]\fP\f4hostname\fP\f3][:\fP\f4port\fP\f3][/\fP\f4servername\fP\f3]\fP |
| 121 | .br |
| 122 | \f3 |
| 123 | .fl |
| 124 | \fP |
| 125 | .fi |
| 126 | |
| 127 | .LP |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 128 | .RS 3 |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 129 | .TP 3 |
| 130 | protocol |
| 131 | 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. |
| 132 | .TP 3 |
| 133 | hostname |
| 134 | A hostname or IP address indicating the target host. If \f2hostname\fP is omitted, then the target host is the local host. |
| 135 | .TP 3 |
| 136 | port |
| 137 | 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. |
| 138 | .TP 3 |
| 139 | servername |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 140 | 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. |
| 141 | .RE |
| 142 | |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 143 | .LP |
| 144 | .RE |
| 145 | .SH "OUTPUT FORMAT" |
| 146 | .LP |
| 147 | |
| 148 | .LP |
| 149 | .LP |
| 150 | The output of the \f3jps\fP command follows the following pattern: |
| 151 | .LP |
| 152 | .nf |
| 153 | \f3 |
| 154 | .fl |
| 155 | \fP\f4lvmid\fP\f3 [ [ \fP\f4classname\fP\f3 | \fP\f4JARfilename\fP\f3 | "Unknown"] [ \fP\f4arg\fP\f3* ] [ \fP\f4jvmarg\fP\f3* ] ]\fP |
| 156 | .br |
| 157 | \f3 |
| 158 | .fl |
| 159 | \fP |
| 160 | .fi |
| 161 | |
| 162 | .LP |
| 163 | .LP |
| 164 | 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. |
| 165 | .br |
| 166 | .br |
| 167 | \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. |
| 168 | .br |
| 169 | |
| 170 | .LP |
| 171 | .SH "EXAMPLES" |
| 172 | .LP |
| 173 | |
| 174 | .LP |
| 175 | .LP |
| 176 | This section provides examples of the \f3jps\fP command. |
| 177 | .LP |
| 178 | .LP |
| 179 | Listing the instrumented JVMs on the local host: |
| 180 | .LP |
| 181 | .nf |
| 182 | \f3 |
| 183 | .fl |
| 184 | \fP\f3jps\fP |
| 185 | .br |
| 186 | |
| 187 | .fl |
| 188 | 18027 Java2Demo.JAR |
| 189 | .br |
| 190 | |
| 191 | .fl |
| 192 | 18032 jps |
| 193 | .br |
| 194 | |
| 195 | .fl |
| 196 | 18005 jstat |
| 197 | .br |
| 198 | |
| 199 | .fl |
| 200 | .fi |
| 201 | |
| 202 | .LP |
| 203 | .LP |
| 204 | Listing the instrumented JVMs on a remote host: |
| 205 | .LP |
| 206 | .LP |
| 207 | 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. |
| 208 | .LP |
| 209 | .nf |
| 210 | \f3 |
| 211 | .fl |
| 212 | \fP\f3jps \-l remote.domain\fP |
| 213 | .br |
| 214 | |
| 215 | .fl |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 216 | 3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 217 | .br |
| 218 | |
| 219 | .fl |
| 220 | 2857 sun.tools.jstatd.jstatd |
| 221 | .br |
| 222 | |
| 223 | .fl |
| 224 | .fi |
| 225 | |
| 226 | .LP |
| 227 | .LP |
| 228 | Listing the instrumented JVMs on a remote host with a non\-default port for the RMI registry |
| 229 | .LP |
| 230 | .LP |
| 231 | 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. |
| 232 | .LP |
| 233 | .nf |
| 234 | \f3 |
| 235 | .fl |
| 236 | \fP\f3jps \-m remote.domain:2002\fP |
| 237 | .br |
| 238 | |
| 239 | .fl |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 240 | 3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 241 | .br |
| 242 | |
| 243 | .fl |
| 244 | 3102 sun.tools.jstatd.jstatd \-p 2002 |
| 245 | .fl |
| 246 | .fi |
| 247 | |
| 248 | .LP |
| 249 | .SH "SEE ALSO" |
| 250 | .LP |
| 251 | .RS 3 |
| 252 | .TP 2 |
| 253 | o |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 254 | java(1) \- the Java Application Launcher |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 255 | .TP 2 |
| 256 | o |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 257 | jstat(1) \- the Java virtual machine Statistics Monitoring Tool |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 258 | .TP 2 |
| 259 | o |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 260 | jstatd(1) \- the jstat daemon |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 261 | .TP 2 |
| 262 | o |
tbell | 16c34dd | 2009-05-04 18:28:26 -0700 | [diff] [blame^] | 263 | rmiregistry(1) \- the Java Remote Object Registry |
duke | 6e45e10 | 2007-12-01 00:00:00 +0000 | [diff] [blame] | 264 | .RE |
| 265 | |
| 266 | .LP |
| 267 | |
| 268 | .LP |
| 269 | |