< prev index next >

src/jdk.jcmd/share/man/jps.1

Print this page


   1 .\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.

   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 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.
  21 .\"
  22 .\" Automatically generated by Pandoc 2.3.1
  23 .\"
  24 .TH "JPS" "1" "2018" "JDK 13" "JDK Commands"
  25 .hy
  26 .SH NAME
  27 .PP
  28 jps \- list the instrumented JVMs on the target system
  29 .SH SYNOPSIS
  30 .PP
  31 \f[B]Note:\f[R] This command is experimental\ and unsupported.
  32 .PP
  33 \f[CB]jps\f[R] [\f[CB]\-q\f[R]] [\f[CB]\-mlvV\f[R]] [\f[I]hostid\f[R]]
  34 .PP
  35 \f[CB]jps\f[R] [\f[CB]\-help\f[R]]
  36 .SH OPTIONS
  37 .TP
  38 .B \f[CB]\-q\f[R]
  39 Suppresses the output of the class name, JAR file name, and arguments
  40 passed to the \f[CB]main\f[R] method, producing a list of only local JVM
  41 identifiers.
  42 .RS
  43 .RE
  44 .TP
  45 .B \f[CB]\-mlvV\f[R]
  46 You can specify any combination of these options.
  47 .RS
  48 .IP \[bu] 2
  49 \f[CB]\-m\f[R] displays the arguments passed to the \f[CB]main\f[R] method.
  50 The output may be \f[CB]null\f[R] for embedded JVMs.
  51 .IP \[bu] 2
  52 \f[CB]\-l\f[R] displays the full package name for the application\[aq]s
  53 \f[CB]main\f[R] class or the full path name to the application\[aq]s JAR
  54 file.
  55 .IP \[bu] 2
  56 \f[CB]\-v\f[R] displays the arguments passed to the JVM.
  57 .IP \[bu] 2
  58 \f[CB]\-V\f[R] suppresses the output of the class name, JAR file name, and
  59 arguments passed to the \f[CB]main\f[R] method, producing a list of only
  60 local JVM identifiers.
  61 .RE
  62 .TP
  63 .B \f[I]hostid\f[R]
  64 The identifier of the host for which the process report should be
  65 generated.
  66 The \f[CB]hostid\f[R] can include optional components that indicate the
  67 communications protocol, port number, and other implementation specific
  68 data.
  69 See \f[B]Host Identifier\f[R].
  70 .RS
  71 .RE
  72 .TP
  73 .B \f[CB]\-help\f[R]
  74 Displays the help message for the \f[CB]jps\f[R] command.
  75 .RS
  76 .RE
  77 .SH DESCRIPTION
  78 .PP
  79 The \f[CB]jps\f[R] command lists the instrumented Java HotSpot VMs on the
  80 target system.
  81 The command is limited to reporting information on JVMs for which it has
  82 the access permissions.
  83 .PP
  84 \f[B]Note:\f[R]
  85 .PP
  86 JDK 10 added support for using the Attach API when attaching to Java
  87 processes running in a separate docker process.
  88 However, the \f[CB]jps\f[R] tool cannot see JVM processes running in a
  89 separate docker instance.
  90 If you are trying to connect a Linux host with a Virtual Machine within
  91 a docker container, you must use tools such as \f[CB]ps\f[R] to look up
  92 the PID of the JVM and then specify the PID on the command line of the
  93 tools that accept the PID.
  94 .PP
  95 If the \f[CB]jps\f[R] command is run without specifying a \f[CB]hostid\f[R],
  96 then it searches for instrumented JVMs on the local host.
  97 If started with a \f[CB]hostid\f[R], then it searches for JVMs on the
  98 indicated host, using the specified protocol and port.
  99 A \f[CB]jstatd\f[R] process is assumed to be running on the target host.
 100 .PP
 101 The \f[CB]jps\f[R] command reports the local JVM identifier, or
 102 \f[CB]lvmid\f[R], for each instrumented JVM found on the target system.
 103 The \f[CB]lvmid\f[R] is typically, but not necessarily, the operating
 104 system\[aq]s process identifier for the JVM process.
 105 With no options, the \f[CB]jps\f[R] command lists each Java
 106 application\[aq]s \f[CB]lvmid\f[R] followed by the short form of the
 107 application\[aq]s class name or jar file name.
 108 The short form of the class name or JAR file name omits the class\[aq]s
 109 package information or the JAR files path information.
 110 .PP
 111 The \f[CB]jps\f[R] command uses the Java launcher to find the class name
 112 and arguments passed to the main method.
 113 If the target JVM is started with a custom launcher, then the class or
 114 JAR file name, and the arguments to the \f[CB]main\f[R] method aren\[aq]t
 115 available.
 116 In this case, the \f[CB]jps\f[R] command outputs the string
 117 \f[CB]Unknown\f[R] for the class name, or JAR file name, and for the
 118 arguments to the \f[CB]main\f[R] method.
 119 .PP
 120 The list of JVMs produced by the \f[CB]jps\f[R] command can be limited by
 121 the permissions granted to the principal running the command.
 122 The command lists only the JVMs for which the principal has access
 123 rights as determined by operating system\-specific access control
 124 mechanisms.
 125 .SH HOST IDENTIFIER
 126 .PP
 127 The host identifier, or \f[CB]hostid\f[R], is a string that indicates the
 128 target system.
 129 The syntax of the \f[CB]hostid\f[R] string corresponds to the syntax of a
 130 URI:
 131 .RS
 132 .PP
 133 [\f[I]protocol\f[R]\f[CB]:\f[R]][[\f[CB]//\f[R]]\f[I]hostname\f[R]][\f[CB]:\f[R]\f[I]port\f[R]][\f[CB]/\f[R]\f[I]servername\f[R]]
 134 .RE
 135 .TP
 136 .B \f[I]protocol\f[R]
 137 The communications protocol.
 138 If the \f[I]protocol\f[R] is omitted and a \f[I]hostname\f[R] isn\[aq]t
 139 specified, then the default protocol is a platform\-specific, optimized,
 140 local protocol.
 141 If the protocol is omitted and a host name is specified, then the
 142 default protocol is \f[CB]rmi\f[R].
 143 .RS
 144 .RE
 145 .TP
 146 .B \f[I]hostname\f[R]
 147 A host name or IP address that indicates the target host.
 148 If you omit the \f[I]hostname\f[R] parameter, then the target host is the
 149 local host.
 150 .RS
 151 .RE
 152 .TP
 153 .B \f[I]port\f[R]
 154 The default port for communicating with the remote server.
 155 If the \f[I]hostname\f[R] parameter is omitted or the \f[I]protocol\f[R]
 156 parameter specifies an optimized, local protocol, then the \f[I]port\f[R]
 157 parameter is ignored.
 158 Otherwise, treatment of the \f[I]port\f[R] parameter is
 159 implementation\-specific.
 160 For the default \f[CB]rmi\f[R] protocol, the \f[I]port\f[R] parameter
 161 indicates the port number for the \f[CB]rmiregistry\f[R] on the remote
 162 host.
 163 If the \f[I]port\f[R] parameter is omitted, and the \f[I]protocol\f[R]
 164 parameter indicates \f[CB]rmi\f[R], then the default \f[CB]rmiregistry\f[R]
 165 port (\f[CB]1099\f[R]) is used.
 166 .RS
 167 .RE
 168 .TP
 169 .B \f[I]servername\f[R]
 170 The treatment of this parameter depends on the implementation.
 171 For the optimized, local protocol, this field is ignored.
 172 For the \f[CB]rmi\f[R] protocol, this parameter is a string that
 173 represents the name of the RMI remote object on the remote host.
 174 See the \f[B]jstatd\f[R] command \f[CB]\-n\f[R] option.
 175 .RS
 176 .RE
 177 .SH OUTPUT FORMAT OF THE JPS COMMAND
 178 .PP
 179 The output of the \f[CB]jps\f[R] command has the following pattern:
 180 .RS
 181 .PP
 182 \f[I]lvmid\f[R] [ [ \f[I]classname\f[R] | \f[I]JARfilename\f[R] |
 183 \f[CB]"Unknown"\f[R]] [ \f[I]arg\f[R]* ] [ \f[I]jvmarg\f[R]* ] ]
 184 .RE
 185 .PP
 186 All output tokens are separated by white space.
 187 An \f[CB]arg\f[R] value that includes embedded white space introduces
 188 ambiguity when attempting to map arguments to their actual positional
 189 parameters.
 190 .PP
 191 \f[B]Note:\f[R]
 192 .PP
 193 It\[aq]s recommended that you don\[aq]t write scripts to parse
 194 \f[CB]jps\f[R] output because the format might change in future releases.
 195 If you write scripts that parse \f[CB]jps\f[R] output, then expect to
 196 modify them for future releases of this tool.
 197 .SH EXAMPLES
 198 .PP
 199 This section provides examples of the \f[CB]jps\f[R] command.
 200 .PP
 201 List the instrumented JVMs on the local host:
 202 .IP
 203 .nf
 204 \f[CB]
 205 jps
 206 18027\ Java2Demo.JAR
 207 18032\ jps
 208 18005\ jstat
 209 \f[R]
 210 .fi
 211 .PP
 212 The following example lists the instrumented JVMs on a remote host.
 213 This example assumes that the \f[CB]jstat\f[R] server and either the its
 214 internal RMI registry or a separate external \f[CB]rmiregistry\f[R]
 215 process are running on the remote host on the default port (port
 216 \f[CB]1099\f[R]).
 217 It also assumes that the local host has appropriate permissions to
 218 access the remote host.
 219 This example includes the \f[CB]\-l\f[R] option to output the long form of
 220 the class names or JAR file names.
 221 .IP
 222 .nf
 223 \f[CB]
 224 jps\ \-l\ remote.domain
 225 3002\ /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
 226 2857\ sun.tools.jstatd.jstatd
 227 \f[R]
 228 .fi
 229 .PP
 230 The following example lists the instrumented JVMs on a remote host with
 231 a nondefault port for the RMI registry.
 232 This example assumes that the \f[CB]jstatd\f[R] server, with an internal
 233 RMI registry bound to port \f[CB]2002\f[R], is running on the remote host.
 234 This example also uses the \f[CB]\-m\f[R] option to include the arguments
 235 passed to the \f[CB]main\f[R] method of each of the listed Java
 236 applications.
 237 .IP
 238 .nf
 239 \f[CB]
 240 jps\ \-m\ remote.domain:2002
 241 3002\ /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
 242 3102\ sun.tools.jstatd.jstatd\ \-p\ 2002
 243 \f[R]
 244 .fi





















   1 '\" t
   2 .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
   3 .\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 .\"
   5 .\" This code is free software; you can redistribute it and/or modify it
   6 .\" under the terms of the GNU General Public License version 2 only, as
   7 .\" published by the Free Software Foundation.
   8 .\"
   9 .\" This code is distributed in the hope that it will be useful, but WITHOUT
  10 .\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 .\" FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 .\" version 2 for more details (a copy is included in the LICENSE file that
  13 .\" accompanied this code).
  14 .\"
  15 .\" You should have received a copy of the GNU General Public License version
  16 .\" 2 along with this work; if not, write to the Free Software Foundation,
  17 .\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 .\"
  19 .\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 .\" or visit www.oracle.com if you need additional information or have any
  21 .\" questions.
  22 .\"
  23 .\"     Arch: generic
  24 .\"     Software: JDK 8
  25 .\"     Date: 21 November 2013
  26 .\"     SectDesc: Monitoring Tools
  27 .\"     Title: jps.1
  28 .\"
  29 .if n .pl 99999
  30 .TH jps 1 "21 November 2013" "JDK 8" "Monitoring Tools"
  31 .\" -----------------------------------------------------------------
  32 .\" * Define some portability stuff
  33 .\" -----------------------------------------------------------------
  34 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  35 .\" http://bugs.debian.org/507673
  36 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  37 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  38 .ie \n(.g .ds Aq \(aq
  39 .el       .ds Aq '
  40 .\" -----------------------------------------------------------------
  41 .\" * set default formatting
  42 .\" -----------------------------------------------------------------
  43 .\" disable hyphenation
  44 .nh
  45 .\" disable justification (adjust text to left margin only)
  46 .ad l
  47 .\" -----------------------------------------------------------------
  48 .\" * MAIN CONTENT STARTS HERE *
  49 .\" -----------------------------------------------------------------
  50 
  51 .SH NAME    
  52 jps \- Lists the instrumented Java Virtual Machines (JVMs) on the target system\&. This command is experimental and unsupported\&.
  53 .SH SYNOPSIS    
  54 .sp     
  55 .nf     
  56 
  57 \fBjps\fR [ \fIoptions\fR ] [ \fIhostid\fR ]
  58 .fi     
  59 .sp     
  60 .TP     
  61 \fIoptions\fR
  62 Command-line options\&. See Options\&.
  63 .TP     
  64 \fIhostid\fR
  65 The identifier of the host for which the process report should be generated\&. The \f3hostid\fR can include optional components that indicate the communications protocol, port number, and other implementation specific data\&. See Host Identifier\&.
  66 .SH DESCRIPTION    
  67 The \f3jps\fR command lists the instrumented Java HotSpot VMs on the target system\&. The command is limited to reporting information on JVMs for which it has the access permissions\&.
  68 .PP
  69 If the \f3jps\fR command is run without specifying a \f3hostid\fR, then it searches for instrumented JVMs on the local host\&. If started with a \f3hostid\fR, then it searches for JVMs on the indicated host, using the specified protocol and port\&. A \f3jstatd\fR process is assumed to be running on the target host\&.
  70 .PP
  71 The \f3jps\fR command reports the local JVM identifier, or \f3lvmid\fR, for each instrumented JVM found on the target system\&. The \f3lvmid\fR is typically, but not necessarily, the operating system\&'s process identifier for the JVM process\&. With no options, \f3jps\fR lists each Java application\&'s \f3lvmid\fR 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\&.
  72 .PP
  73 The \f3jps\fR command uses the Java launcher to find the class name and arguments passed to the main method\&. If the target JVM is started with a custom launcher, then the class or JAR file name and the arguments to the \f3main\fR method are not available\&. In this case, the \f3jps\fR command outputs the string \f3Unknown\fR for the class name or JAR file name and for the arguments to the \f3main\fR method\&.
  74 .PP
  75 The list of JVMs produced by the \f3jps\fR command can be limited by the permissions granted to the principal running the command\&. The command only lists the JVMs for which the principle has access rights as determined by operating system-specific access control mechanisms\&.
  76 .SH OPTIONS    
  77 The \f3jps\fR command supports a number of options that modify the output of the command\&. These options are subject to change or removal in the future\&.
  78 .TP
  79 -q
  80 .br
  81 Suppresses the output of the class name, JAR file name, and arguments passed to the \f3main\fR method, producing only a list of local JVM identifiers\&.
  82 .TP
  83 -m
  84 .br
  85 Displays the arguments passed to the \f3main\fR method\&. The output may be \f3null\fR for embedded JVMs\&.
  86 .TP
  87 -l
  88 .br
  89 Displays the full package name for the application\&'s \f3main\fR class or the full path name to the application\&'s JAR file\&.
  90 .TP
  91 -v
  92 .br
  93 Displays the arguments passed to the JVM\&.
  94 .TP
  95 -V
  96 .br
  97 Suppresses the output of the class name, JAR file name, and arguments passed to the main method, producing only a list of local JVM identifiers\&.
  98 .TP
  99 -J\f3option\fR
 100 .br
 101 Passes \f3option\fR to the JVM, where option is one of the \f3options\fR described on the reference page for the Java application launcher\&. For example, \f3-J-Xms48m\fR sets the startup memory to 48 MB\&. See java(1)\&.
 102 .SH HOST\ IDENTIFIER    
 103 The host identifier, or \f3hostid\fR is a string that indicates the target system\&. The syntax of the \f3hostid\fR string corresponds to the syntax of a URI:
 104 .sp     
 105 .nf     
 106 \f3[protocol:][[//]hostname][:port][/servername]\fP
 107 .fi     
 108 .nf     
 109 \f3\fP
 110 .fi     
 111 .sp     
 112 .TP     
 113 \fIprotocol\fR
 114 The communications protocol\&. If the \f3protocol\fR is omitted and a \f3hostname\fR is not specified, then the default protocol is a platform-specific, optimized, local protocol\&. If the protocol is omitted and a host name is specified, then the default protocol is \f3rmi\fR\&.
 115 .TP     
 116 hostname
 117 A hostname or IP address that indicates the target host\&. If you omit the \f3hostname\fR parameter, then the target host is the local host\&.
 118 .TP     
 119 port
 120 The default port for communicating with the remote server\&. If the \f3hostname\fR parameter is omitted or the \f3protocol\fR parameter specifies an optimized, local protocol, then the \f3port\fR parameter is ignored\&. Otherwise, treatment of the \f3port\fR parameter is implementation specific\&. For the default \f3rmi\fR protocol, the \f3port\fR parameter indicates the port number for the rmiregistry on the remote host\&. If the \f3port\fR parameter is omitted, and the \f3protocol\fR parameter indicates \f3rmi\fR, then the default rmiregistry port (1099) is used\&.
 121 .TP     
 122 servername
 123 The treatment of this parameter depends on the implementation\&. For the optimized, local protocol, this field is ignored\&. For the \f3rmi\fR protocol, this parameter is a string that represents the name of the RMI remote object on the remote host\&. See the \f3jstatd\fR command \f3-n\fRoption for more information\&.
 124 .SH OUTPUT\ FORMAT    
 125 The output of the \f3jps\fR command follows the following pattern:
 126 .sp     
 127 .nf     
 128 \f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]\fP
 129 .fi     
 130 .nf     
 131 \f3\fP
 132 .fi     
 133 .sp     
 134 All output tokens are separated by white space\&. An \f3arg\fR value that includes embedded white space introduces ambiguity when attempting to map arguments to their actual positional parameters\&.
 135 .PP
 136 \fINote:\fR It is recommended that you do not write scripts to parse \f3jps\fR output because the format might change in future releases\&. If you write scripts that parse \f3jps\fR output, then expect to modify them for future releases of this tool\&.
 137 .SH EXAMPLES    
 138 This section provides examples of the \f3jps\fR command\&.






























































 139 .PP
 140 List the instrumented JVMs on the local host:
 141 .sp     
 142 .nf     
 143 \f3jps\fP
 144 .fi     
 145 .nf     
 146 \f318027 Java2Demo\&.JAR\fP
 147 .fi     
 148 .nf     
 149 \f318032 jps\fP
 150 .fi     
 151 .nf     
 152 \f318005 jstat\fP
 153 .fi     
 154 .nf     
 155 \f3\fP
 156 .fi     
 157 .sp     
 158 The following example lists the instrumented JVMs on a remote host\&. This example assumes that the \f3jstat\fR server and either the its internal RMI registry or a separate external rmiregistry 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 \f3-l\fR option to output the long form of the class names or JAR file names\&.
 159 .sp     
 160 .nf     
 161 \f3jps \-l remote\&.domain\fP
 162 .fi     
 163 .nf     
 164 \f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
 165 .fi     
 166 .nf     
 167 \f32857 sun\&.tools\&.jstatd\&.jstatd\fP
 168 .fi     
 169 .nf     
 170 \f3\fP
 171 .fi     
 172 .sp     
 173 The following example lists the instrumented JVMs on a remote host with a non-default port for the RMI registry\&. This example assumes that the \f3jstatd\fR server, with an internal RMI registry bound to port 2002, is running on the remote host\&. This example also uses the \f3-m\fR option to include the arguments passed to the \f3main\fR method of each of the listed Java applications\&.
 174 .sp     
 175 .nf     
 176 \f3jps \-m remote\&.domain:2002\fP
 177 .fi     
 178 .nf     
 179 \f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
 180 .fi     
 181 .nf     
 182 \f33102 sun\&.tools\&.jstatd\&.jstatd \-p 2002\fP
 183 .fi     
 184 .nf     
 185 \f3\fP
 186 .fi     
 187 .sp     
 188 .SH SEE\ ALSO    
 189 .TP 0.2i    
 190 \(bu
 191 java(1)
 192 .TP 0.2i    
 193 \(bu
 194 jstat(1)
 195 .TP 0.2i    
 196 \(bu
 197 jstatd(1)
 198 .TP 0.2i    
 199 \(bu
 200 rmiregistry(1)
 201 .RE
 202 .br
 203 'pl 8.5i
 204 'bp
< prev index next >