Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
This code is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License version 2 only, as
published by the Free Software Foundation.
This code is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
version 2 for more details (a copy is included in the LICENSE file that
accompanied this code).
You should have received a copy of the GNU General Public License version
2 along with this work; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
or visit www.oracle.com if you need additional information or have any
questions.
Arch: generic
Software: JDK 8
Date: 21 November 2013
SectDesc: Monitoring Tools
Title: jps.1
* Define some portability stuff
-----------------------------------------------------------------
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://bugs.debian.org/507673
http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-----------------------------------------------------------------
* set default formatting
-----------------------------------------------------------------
disable hyphenation
disable justification (adjust text to left margin only)
-----------------------------------------------------------------
* MAIN CONTENT STARTS HERE *
-----------------------------------------------------------------
jps [ options ] [ hostid ]
options Command-line options. See Options.
hostid The identifier of the host for which the process report should be generated. The \f3hostid can include optional components that indicate the communications protocol, port number, and other implementation specific data. See Host Identifier.
If the \f3jps command is run without specifying a \f3hostid, then it searches for instrumented JVMs on the local host. If started with a \f3hostid, then it searches for JVMs on the indicated host, using the specified protocol and port. A \f3jstatd process is assumed to be running on the target host.
The \f3jps command reports the local JVM identifier, or \f3lvmid, for each instrumented JVM found on the target system. The \f3lvmid is typically, but not necessarily, the operating system's process identifier for the JVM process. With no options, \f3jps lists each Java application's \f3lvmid 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.
The \f3jps 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 method are not available. In this case, the \f3jps command outputs the string \f3Unknown for the class name or JAR file name and for the arguments to the \f3main method.
The list of JVMs produced by the \f3jps 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.
-q
Suppresses the output of the class name, JAR file name, and arguments passed to the \f3main method, producing only a list of local JVM identifiers.
-m
Displays the arguments passed to the \f3main method. The output may be \f3null for embedded JVMs.
-l
Displays the full package name for the application's \f3main class or the full path name to the application's JAR file.
-v
Displays the arguments passed to the JVM.
-V
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.
-J\f3option
Passes \f3option to the JVM, where option is one of the \f3options described on the reference page for the Java application launcher. For example, \f3-J-Xms48m sets the startup memory to 48 MB. See java(1).
\f3[protocol:][[//]hostname][:port][/servername]
\f3
protocol The communications protocol. If the \f3protocol is omitted and a \f3hostname 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.
hostname A hostname or IP address that indicates the target host. If you omit the \f3hostname parameter, then the target host is the local host.
port The default port for communicating with the remote server. If the \f3hostname parameter is omitted or the \f3protocol parameter specifies an optimized, local protocol, then the \f3port parameter is ignored. Otherwise, treatment of the \f3port parameter is implementation specific. For the default \f3rmi protocol, the \f3port parameter indicates the port number for the rmiregistry on the remote host. If the \f3port parameter is omitted, and the \f3protocol parameter indicates \f3rmi, then the default rmiregistry port (1099) is used.
servername The treatment of this parameter depends on the implementation. For the optimized, local protocol, this field is ignored. For the \f3rmi protocol, this parameter is a string that represents the name of the RMI remote object on the remote host. See the \f3jstatd command \f3-noption for more information.
\f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]
\f3All output tokens are separated by white space. An \f3arg value that includes embedded white space introduces ambiguity when attempting to map arguments to their actual positional parameters.
Note: It is recommended that you do not write scripts to parse \f3jps output because the format might change in future releases. If you write scripts that parse \f3jps output, then expect to modify them for future releases of this tool.
List the instrumented JVMs on the local host:
\f3jps
\f318027 Java2Demo.JAR
\f318032 jps
\f318005 jstat
\f3The following example lists the instrumented JVMs on a remote host. This example assumes that the \f3jstat 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 option to output the long form of the class names or JAR file names.
\f3jps -l remote.domain
\f33002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
\f32857 sun.tools.jstatd.jstatd
\f3The 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 server, with an internal RMI registry bound to port 2002, is running on the remote host. This example also uses the \f3-m option to include the arguments passed to the \f3main method of each of the listed Java applications.
\f3jps -m remote.domain:2002
\f33002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
\f33102 sun.tools.jstatd.jstatd -p 2002
\f3
0.2i java(1)
0.2i jstat(1)
0.2i jstatd(1)
0.2i rmiregistry(1)
'pl 8.5i 'bp