jps.1 8.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. '\" t
  2. .\" Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.
  3. .\" Arch: generic
  4. .\" Software: JDK 8
  5. .\" Date: 21 November 2013
  6. .\" SectDesc: Monitoring Tools
  7. .\" Title: jps.1
  8. .\"
  9. .if n .pl 99999
  10. .TH jps 1 "21 November 2013" "JDK 8" "Monitoring Tools"
  11. .\" -----------------------------------------------------------------
  12. .\" * Define some portability stuff
  13. .\" -----------------------------------------------------------------
  14. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  15. .\" http://bugs.debian.org/507673
  16. .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
  17. .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  18. .ie \n(.g .ds Aq \(aq
  19. .el .ds Aq '
  20. .\" -----------------------------------------------------------------
  21. .\" * set default formatting
  22. .\" -----------------------------------------------------------------
  23. .\" disable hyphenation
  24. .nh
  25. .\" disable justification (adjust text to left margin only)
  26. .ad l
  27. .\" -----------------------------------------------------------------
  28. .\" * MAIN CONTENT STARTS HERE *
  29. .\" -----------------------------------------------------------------
  30. .SH NAME
  31. jps \- Lists the instrumented Java Virtual Machines (JVMs) on the target system\&. This command is experimental and unsupported\&.
  32. .SH SYNOPSIS
  33. .sp
  34. .nf
  35. \fBjps\fR [ \fIoptions\fR ] [ \fIhostid\fR ]
  36. .fi
  37. .sp
  38. .TP
  39. \fIoptions\fR
  40. Command-line options\&. See Options\&.
  41. .TP
  42. \fIhostid\fR
  43. 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\&.
  44. .SH DESCRIPTION
  45. 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\&.
  46. .PP
  47. 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\&.
  48. .PP
  49. 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\&.
  50. .PP
  51. 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\&.
  52. .PP
  53. 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\&.
  54. .SH OPTIONS
  55. 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\&.
  56. .TP
  57. -q
  58. .br
  59. 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\&.
  60. .TP
  61. -m
  62. .br
  63. Displays the arguments passed to the \f3main\fR method\&. The output may be \f3null\fR for embedded JVMs\&.
  64. .TP
  65. -l
  66. .br
  67. Displays the full package name for the application\&'s \f3main\fR class or the full path name to the application\&'s JAR file\&.
  68. .TP
  69. -v
  70. .br
  71. Displays the arguments passed to the JVM\&.
  72. .TP
  73. -V
  74. .br
  75. 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\&.
  76. .TP
  77. -J\f3option\fR
  78. .br
  79. 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)\&.
  80. .SH HOST\ IDENTIFIER
  81. 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:
  82. .sp
  83. .nf
  84. \f3[protocol:][[//]hostname][:port][/servername]\fP
  85. .fi
  86. .nf
  87. \f3\fP
  88. .fi
  89. .sp
  90. .TP
  91. \fIprotocol\fR
  92. 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\&.
  93. .TP
  94. hostname
  95. 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\&.
  96. .TP
  97. port
  98. 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\&.
  99. .TP
  100. servername
  101. 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\&.
  102. .SH OUTPUT\ FORMAT
  103. The output of the \f3jps\fR command follows the following pattern:
  104. .sp
  105. .nf
  106. \f3lvmid [ [ classname | JARfilename | "Unknown"] [ arg* ] [ jvmarg* ] ]\fP
  107. .fi
  108. .nf
  109. \f3\fP
  110. .fi
  111. .sp
  112. 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\&.
  113. .PP
  114. \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\&.
  115. .SH EXAMPLES
  116. This section provides examples of the \f3jps\fR command\&.
  117. .PP
  118. List the instrumented JVMs on the local host:
  119. .sp
  120. .nf
  121. \f3jps\fP
  122. .fi
  123. .nf
  124. \f318027 Java2Demo\&.JAR\fP
  125. .fi
  126. .nf
  127. \f318032 jps\fP
  128. .fi
  129. .nf
  130. \f318005 jstat\fP
  131. .fi
  132. .nf
  133. \f3\fP
  134. .fi
  135. .sp
  136. 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\&.
  137. .sp
  138. .nf
  139. \f3jps \-l remote\&.domain\fP
  140. .fi
  141. .nf
  142. \f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
  143. .fi
  144. .nf
  145. \f32857 sun\&.tools\&.jstatd\&.jstatd\fP
  146. .fi
  147. .nf
  148. \f3\fP
  149. .fi
  150. .sp
  151. 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\&.
  152. .sp
  153. .nf
  154. \f3jps \-m remote\&.domain:2002\fP
  155. .fi
  156. .nf
  157. \f33002 /opt/jdk1\&.7\&.0/demo/jfc/Java2D/Java2Demo\&.JAR\fP
  158. .fi
  159. .nf
  160. \f33102 sun\&.tools\&.jstatd\&.jstatd \-p 2002\fP
  161. .fi
  162. .nf
  163. \f3\fP
  164. .fi
  165. .sp
  166. .SH SEE\ ALSO
  167. .TP 0.2i
  168. \(bu
  169. java(1)
  170. .TP 0.2i
  171. \(bu
  172. jstat(1)
  173. .TP 0.2i
  174. \(bu
  175. jstatd(1)
  176. .TP 0.2i
  177. \(bu
  178. rmiregistry(1)
  179. .RE
  180. .br
  181. 'pl 8.5i
  182. 'bp