1JPS(1)                           JDK Commands                           JPS(1)
2
3
4

NAME

6       jps - list the instrumented JVMs on the target system
7

SYNOPSIS

9       Note: This command is experimental and unsupported.
10
11       jps [-q] [-mlvV] [hostid]
12
13       jps [-help]
14

OPTIONS

16       -q     Suppresses  the output of the class name, JAR file name, and ar‐
17              guments passed to the main method, producing a list of only  lo‐
18              cal JVM identifiers.
19
20       -mlvV  You can specify any combination of these options.
21
22-m displays the arguments passed to the main method.  The out‐
23                put may be null for embedded JVMs.
24
25-l displays the full package name for the  application's  main
26                class or the full path name to the application's JAR file.
27
28-v displays the arguments passed to the JVM.
29
30-V suppresses the output of the class name, JAR file name, and
31                arguments passed to the main method, producing a list of  only
32                local JVM identifiers.
33
34       hostid The  identifier  of the host for which the process report should
35              be generated.  The hostid can include optional  components  that
36              indicate the communications protocol, port number, and other im‐
37              plementation specific data.  See Host Identifier.
38
39       -help  Displays the help message for the jps command.
40

DESCRIPTION

42       The jps command lists the instrumented Java HotSpot VMs on  the  target
43       system.   The  command  is limited to reporting information on JVMs for
44       which it has the access permissions.
45
46       If the jps command is run without specifying a hostid, then it searches
47       for  instrumented  JVMs  on  the local host.  If started with a hostid,
48       then it searches for JVMs on the indicated host,  using  the  specified
49       protocol  and  port.   A jstatd process is assumed to be running on the
50       target host.
51
52       The jps command reports the local JVM identifier, or  lvmid,  for  each
53       instrumented  JVM  found on the target system.  The lvmid is typically,
54       but not necessarily, the operating system's process identifier for  the
55       JVM process.  With no options, the jps command lists each Java applica‐
56       tion's lvmid followed by the short form of the application's class name
57       or  jar  file  name.  The short form of the class name or JAR file name
58       omits the class's package information or the JAR  files  path  informa‐
59       tion.
60
61       The jps command uses the Java launcher to find the class name and argu‐
62       ments passed to the main method.  If the target JVM is started  with  a
63       custom  launcher, then the class or JAR file name, and the arguments to
64       the main method aren't available.  In this case, the jps  command  out‐
65       puts  the  string Unknown for the class name, or JAR file name, and for
66       the arguments to the main method.
67
68       The list of JVMs produced by the jps command can be limited by the per‐
69       missions  granted  to  the  principal running the command.  The command
70       lists only the JVMs for which the principal has access rights as deter‐
71       mined by operating system-specific access control mechanisms.
72

HOST IDENTIFIER

74       The  host  identifier, or hostid, is a string that indicates the target
75       system.  The syntax of the hostid string corresponds to the syntax of a
76       URI:
77
78              [protocol:][[//]hostname][:port][/servername]
79
80       protocol
81              The  communications  protocol.  If the protocol is omitted and a
82              hostname isn't specified, then the default protocol is  a  plat‐
83              form-specific,  optimized,  local  protocol.  If the protocol is
84              omitted and a host name is specified, then the default  protocol
85              is rmi.
86
87       hostname
88              A  host  name  or IP address that indicates the target host.  If
89              you omit the hostname parameter, then the target host is the lo‐
90              cal host.
91
92       port   The  default  port for communicating with the remote server.  If
93              the hostname parameter is  omitted  or  the  protocol  parameter
94              specifies  an optimized, local protocol, then the port parameter
95              is ignored.  Otherwise, treatment of the port parameter  is  im‐
96              plementation-specific.   For  the default rmi protocol, the port
97              parameter indicates the port number for the rmiregistry  on  the
98              remote host.  If the port parameter is omitted, and the protocol
99              parameter indicates  rmi,  then  the  default  rmiregistry  port
100              (1099) is used.
101
102       servername
103              The  treatment  of this parameter depends on the implementation.
104              For the optimized, local protocol, this field is  ignored.   For
105              the rmi protocol, this parameter is a string that represents the
106              name of the RMI remote object on the remote host.  See  the  js‐
107              tatd command -n option.
108

OUTPUT FORMAT OF THE JPS COMMAND

110       The output of the jps command has the following pattern:
111
112              lvmid  [  [  classname | JARfilename | "Unknown"] [ arg* ] [ jv‐
113              marg* ] ]
114
115       All output tokens are separated by white space.  An arg value that  in‐
116       cludes embedded white space introduces ambiguity when attempting to map
117       arguments to their actual positional parameters.
118
119       Note:
120
121       It's recommended that you don't write scripts to parse jps  output  be‐
122       cause the format might change in future releases.  If you write scripts
123       that parse jps output, then expect to modify them for  future  releases
124       of this tool.
125

EXAMPLES

127       This section provides examples of the jps command.
128
129       List the instrumented JVMs on the local host:
130
131              jps
132              18027 Java2Demo.JAR
133              18032 jps
134              18005 jstat
135
136       The  following  example  lists  the instrumented JVMs on a remote host.
137       This example assumes that the jstat server and either the its  internal
138       RMI  registry or a separate external rmiregistry process are running on
139       the remote host on the default port (port 1099).  It also assumes  that
140       the  local  host has appropriate permissions to access the remote host.
141       This example includes the -l option to output  the  long  form  of  the
142       class names or JAR file names.
143
144              jps -l remote.domain
145              3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
146              2857 sun.tools.jstatd.jstatd
147
148       The following example lists the instrumented JVMs on a remote host with
149       a nondefault port for the RMI registry.  This example assumes that  the
150       jstatd  server,  with  an  internal RMI registry bound to port 2002, is
151       running on the remote host.  This example also uses the  -m  option  to
152       include  the  arguments passed to the main method of each of the listed
153       Java applications.
154
155              jps -m remote.domain:2002
156              3002 /opt/jdk1.7.0/demo/jfc/Java2D/Java2Demo.JAR
157              3102 sun.tools.jstatd.jstatd -p 2002
158
159
160
161JDK 17                               2021                               JPS(1)
Impressum