author | mbaesken |
Fri, 13 Sep 2019 11:04:46 +0200 | |
changeset 58173 | 6a30ad1cfeec |
parent 55666 | 340d73f42b3c |
child 58679 | 9c3209ff7550 |
permissions | -rw-r--r-- |
55140 | 1 |
.\" Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved. |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
2 |
.\" DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
3 |
.\" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
4 |
.\" This code is free software; you can redistribute it and/or modify it |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
5 |
.\" under the terms of the GNU General Public License version 2 only, as |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
6 |
.\" published by the Free Software Foundation. |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
7 |
.\" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
8 |
.\" This code is distributed in the hope that it will be useful, but WITHOUT |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
9 |
.\" ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
10 |
.\" FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
11 |
.\" version 2 for more details (a copy is included in the LICENSE file that |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
12 |
.\" accompanied this code). |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
13 |
.\" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
14 |
.\" You should have received a copy of the GNU General Public License version |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
15 |
.\" 2 along with this work; if not, write to the Free Software Foundation, |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
16 |
.\" Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
17 |
.\" |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
18 |
.\" Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
19 |
.\" or visit www.oracle.com if you need additional information or have any |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
20 |
.\" questions. |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
21 |
.\" |
55140 | 22 |
.\" Automatically generated by Pandoc 2.3.1 |
21743 | 23 |
.\" |
55140 | 24 |
.TH "JAVAP" "1" "2018" "JDK 13" "JDK Commands" |
25 |
.hy |
|
26 |
.SH NAME |
|
27 |
.PP |
|
28 |
javap \- disassemble one or more class files |
|
29 |
.SH SYNOPSIS |
|
30 |
.PP |
|
31 |
\f[CB]javap\f[R] [\f[I]options\f[R]] \f[I]classes\f[R]... |
|
32 |
.TP |
|
33 |
.B \f[I]options\f[R] |
|
34 |
Specifies the command\-line options. |
|
35 |
See \f[B]Options for javap\f[R]. |
|
36 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
37 |
.RE |
55140 | 38 |
.TP |
39 |
.B \f[I]classes\f[R] |
|
40 |
Specifies one or more classes separated by spaces to be processed for |
|
41 |
annotations. |
|
42 |
You can specify a class that can be found in the class path by its file |
|
43 |
name, URL, or by its fully qualified class name. |
|
44 |
.RS |
|
45 |
.PP |
|
46 |
Examples: |
|
47 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
48 |
.PP |
55140 | 49 |
\f[CB]path/to/MyClass.class\f[R] |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
50 |
.RE |
55140 | 51 |
.RS |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
52 |
.PP |
55140 | 53 |
\f[CB]jar:file:///path/to/MyJar.jar!/mypkg/MyClass.class\f[R] |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
54 |
.RE |
55140 | 55 |
.RS |
56 |
.PP |
|
57 |
\f[CB]java.lang.Object\f[R] |
|
58 |
.RE |
|
59 |
.RE |
|
60 |
.SH DESCRIPTION |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
61 |
.PP |
55140 | 62 |
The \f[CB]javap\f[R] command disassembles one or more class files. |
63 |
The output depends on the options used. |
|
64 |
When no options are used, the \f[CB]javap\f[R] command prints the |
|
65 |
protected and public fields, and methods of the classes passed to it. |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
66 |
.PP |
55140 | 67 |
The \f[CB]javap\f[R] command isn\[aq]t multirelease JAR aware. |
68 |
Using the class path form of the command results in viewing the base |
|
69 |
entry in all JAR files, multirelease or not. |
|
70 |
Using the URL form, you can use the URL form of an argument to specify a |
|
71 |
specific version of a class to be disassembled. |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
72 |
.PP |
55140 | 73 |
The \f[CB]javap\f[R] command prints its output to \f[CB]stdout\f[R]. |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
74 |
.PP |
55140 | 75 |
\f[B]Note:\f[R] |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
76 |
.PP |
55140 | 77 |
In tools that support \f[CB]\-\-\f[R] style options, the GNU\-style |
78 |
options can use the equal sign (\f[CB]=\f[R]) instead of a white space to |
|
79 |
separate the name of an option from its value. |
|
80 |
.SH OPTIONS FOR JAVAP |
|
81 |
.TP |
|
82 |
.B \f[CB]\-help\f[R], \f[CB]\-\-help\f[R] , or \f[CB]\-?\f[R] |
|
83 |
Prints a help message for the \f[CB]javap\f[R] command. |
|
84 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
85 |
.RE |
55140 | 86 |
.TP |
87 |
.B \f[CB]\-version\f[R] |
|
88 |
Prints release information. |
|
89 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
90 |
.RE |
55140 | 91 |
.TP |
92 |
.B \f[CB]\-verbose\f[R] or \f[CB]\-v\f[R] |
|
93 |
Prints additional information about the selected class. |
|
94 |
.RS |
|
95 |
.RE |
|
96 |
.TP |
|
97 |
.B \f[CB]\-l\f[R] |
|
98 |
Prints line and local variable tables. |
|
99 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
100 |
.RE |
55140 | 101 |
.TP |
102 |
.B \f[CB]\-public\f[R] |
|
103 |
Shows only public classes and members. |
|
104 |
.RS |
|
105 |
.RE |
|
106 |
.TP |
|
107 |
.B \f[CB]\-protected\f[R] |
|
108 |
Shows only protected and public classes and members. |
|
109 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
110 |
.RE |
55140 | 111 |
.TP |
112 |
.B \f[CB]\-package\f[R] |
|
113 |
Shows package/protected/public classes and members (default). |
|
114 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
115 |
.RE |
55140 | 116 |
.TP |
117 |
.B \f[CB]\-private\f[R] or \f[CB]\-p\f[R] |
|
118 |
Shows all classes and members. |
|
119 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
120 |
.RE |
55140 | 121 |
.TP |
122 |
.B \f[CB]\-c\f[R] |
|
123 |
Prints disassembled code, for example, the instructions that comprise |
|
124 |
the Java bytecodes, for each of the methods in the class. |
|
125 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
126 |
.RE |
55140 | 127 |
.TP |
128 |
.B \f[CB]\-s\f[R] |
|
129 |
Prints internal type signatures. |
|
130 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
131 |
.RE |
55140 | 132 |
.TP |
133 |
.B \f[CB]\-sysinfo\f[R] |
|
55666 | 134 |
Shows system information (path, size, date, SHA\-256 hash) of the class |
135 |
being processed. |
|
55140 | 136 |
.RS |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
137 |
.RE |
55140 | 138 |
.TP |
139 |
.B \f[CB]\-constants\f[R] |
|
140 |
Shows \f[CB]static\ final\f[R] constants. |
|
141 |
.RS |
|
142 |
.RE |
|
143 |
.TP |
|
144 |
.B \f[CB]\-\-module\f[R] \f[I]module\f[R] or \f[CB]\-m\f[R] \f[I]module\f[R] |
|
145 |
Specifies the module containing classes to be disassembled. |
|
146 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
147 |
.RE |
55140 | 148 |
.TP |
149 |
.B \f[CB]\-\-module\-path\f[R] \f[I]path\f[R] |
|
150 |
Specifies where to find application modules. |
|
151 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
152 |
.RE |
55140 | 153 |
.TP |
154 |
.B \f[CB]\-\-system\f[R] \f[I]jdk\f[R] |
|
155 |
Specifies where to find system modules. |
|
156 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
157 |
.RE |
55140 | 158 |
.TP |
159 |
.B \f[CB]\-\-class\-path\f[R] \f[I]path\f[R], \f[CB]\-classpath\f[R] \f[I]path\f[R], or \f[CB]\-cp\f[R] \f[I]path\f[R] |
|
160 |
Specifies the path that the \f[CB]javap\f[R] command uses to find user |
|
161 |
class files. |
|
162 |
It overrides the default or the \f[CB]CLASSPATH\f[R] environment variable |
|
163 |
when it\[aq]s set. |
|
164 |
.RS |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
165 |
.RE |
55140 | 166 |
.TP |
167 |
.B \f[CB]\-bootclasspath\f[R] \f[I]path\f[R] |
|
168 |
Overrides the location of bootstrap class files. |
|
169 |
.RS |
|
170 |
.RE |
|
171 |
.TP |
|
55666 | 172 |
.B \f[CB]\-\-multi\-release\f[R] \f[I]version\f[R] |
173 |
Specifies the version to select in multi\-release JAR files. |
|
174 |
.RS |
|
175 |
.RE |
|
176 |
.TP |
|
55140 | 177 |
.B \f[CB]\-J\f[R]\f[I]option\f[R] |
178 |
Passes the specified option to the JVM. |
|
179 |
For example: |
|
180 |
.RS |
|
181 |
.IP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
182 |
.nf |
55140 | 183 |
\f[CB] |
184 |
javap\ \-J\-version |
|
185 |
||
186 |
javap\ \-J\-Djava.security.manager\ \-J\-Djava.security.policy=MyPolicy\ MyClassName |
|
187 |
\f[R] |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
188 |
.fi |
55140 | 189 |
.PP |
190 |
See \f[I]Overview of Java Options\f[R] in \f[B]java\f[R]. |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
191 |
.RE |
55140 | 192 |
.SH JAVAP EXAMPLE |
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
193 |
.PP |
55140 | 194 |
Compile the following \f[CB]HelloWorldFrame\f[R] class: |
195 |
.IP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
196 |
.nf |
55140 | 197 |
\f[CB] |
198 |
import\ java.awt.Graphics; |
|
199 |
||
200 |
import\ javax.swing.JFrame; |
|
201 |
import\ javax.swing.JPanel; |
|
202 |
||
203 |
public\ class\ HelloWorldFrame\ extends\ JFrame\ { |
|
204 |
||
205 |
\ \ \ String\ message\ =\ "Hello\ World!"; |
|
206 |
||
207 |
\ \ \ public\ HelloWorldFrame(){ |
|
208 |
\ \ \ \ \ \ \ \ setContentPane(new\ JPanel(){ |
|
209 |
\ \ \ \ \ \ \ \ \ \ \ \ \@Override |
|
210 |
\ \ \ \ \ \ \ \ \ \ \ \ protected\ void\ paintComponent(Graphics\ g)\ { |
|
211 |
\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ g.drawString(message,\ 15,\ 30); |
|
212 |
\ \ \ \ \ \ \ \ \ \ \ \ } |
|
213 |
\ \ \ \ \ \ \ \ }); |
|
214 |
\ \ \ \ \ \ \ \ setSize(100,\ 100); |
|
215 |
\ \ \ \ } |
|
216 |
\ \ \ \ public\ static\ void\ main(String[]\ args)\ { |
|
217 |
\ \ \ \ \ \ \ \ HelloWorldFrame\ frame\ =\ new\ HelloWorldFrame(); |
|
218 |
\ \ \ \ \ \ \ \ frame.setVisible(true); |
|
219 |
||
220 |
\ \ \ \ } |
|
221 |
||
222 |
} |
|
223 |
\f[R] |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
224 |
.fi |
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
225 |
.PP |
55140 | 226 |
The output from the \f[CB]javap\ HelloWorldFrame.class\f[R] command yields |
227 |
the following: |
|
228 |
.IP |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
229 |
.nf |
55140 | 230 |
\f[CB] |
231 |
Compiled\ from\ "HelloWorldFrame.java" |
|
232 |
public\ class\ HelloWorldFrame\ extends\ javax.swing.JFrame\ { |
|
233 |
\ \ java.lang.String\ message; |
|
234 |
\ \ public\ HelloWorldFrame(); |
|
235 |
\ \ public\ static\ void\ main(java.lang.String[]); |
|
236 |
} |
|
237 |
\f[R] |
|
31876
91b22707521a
8131105: Header Template for nroff man pages *.1 files contains errors
mfang
parents:
21743
diff
changeset
|
238 |
.fi |
55140 | 239 |
.PP |
240 |
The output from the \f[CB]javap\ \-c\ HelloWorldFrame.class\f[R] command |
|
241 |
yields the following: |
|
242 |
.IP |
|
243 |
.nf |
|
244 |
\f[CB] |
|
245 |
Compiled\ from\ "HelloWorldFrame.java" |
|
246 |
public\ class\ HelloWorldFrame\ extends\ javax.swing.JFrame\ { |
|
247 |
\ \ java.lang.String\ message; |
|
248 |
||
249 |
\ \ public\ HelloWorldFrame(); |
|
250 |
\ \ \ \ Code: |
|
251 |
\ \ \ \ \ \ \ 0:\ aload_0 |
|
252 |
\ \ \ \ \ \ \ 1:\ invokespecial\ #1\ \ \ \ \ \ \ \ //\ Method\ javax/swing/JFrame."<init>":()V |
|
253 |
\ \ \ \ \ \ \ 4:\ aload_0 |
|
254 |
\ \ \ \ \ \ \ 5:\ ldc\ \ \ \ \ \ \ \ \ \ \ #2\ \ \ \ \ \ \ \ //\ String\ Hello\ World! |
|
255 |
\ \ \ \ \ \ \ 7:\ putfield\ \ \ \ \ \ #3\ \ \ \ \ \ \ \ //\ Field\ message:Ljava/lang/String; |
|
256 |
\ \ \ \ \ \ 10:\ aload_0 |
|
257 |
\ \ \ \ \ \ 11:\ new\ \ \ \ \ \ \ \ \ \ \ #4\ \ \ \ \ \ \ \ //\ class\ HelloWorldFrame$1 |
|
258 |
\ \ \ \ \ \ 14:\ dup |
|
259 |
\ \ \ \ \ \ 15:\ aload_0 |
|
260 |
\ \ \ \ \ \ 16:\ invokespecial\ #5\ \ \ \ \ \ \ \ //\ Method\ HelloWorldFrame$1."<init>":(LHelloWorldFrame;)V |
|
261 |
\ \ \ \ \ \ 19:\ invokevirtual\ #6\ \ \ \ \ \ \ \ //\ Method\ setContentPane:(Ljava/awt/Container;)V |
|
262 |
\ \ \ \ \ \ 22:\ aload_0 |
|
263 |
\ \ \ \ \ \ 23:\ bipush\ \ \ \ \ \ \ \ 100 |
|
264 |
\ \ \ \ \ \ 25:\ bipush\ \ \ \ \ \ \ \ 100 |
|
265 |
\ \ \ \ \ \ 27:\ invokevirtual\ #7\ \ \ \ \ \ \ \ //\ Method\ setSize:(II)V |
|
266 |
\ \ \ \ \ \ 30:\ return |
|
267 |
||
268 |
\ \ public\ static\ void\ main(java.lang.String[]); |
|
269 |
\ \ \ \ Code: |
|
270 |
\ \ \ \ \ \ \ 0:\ new\ \ \ \ \ \ \ \ \ \ \ #8\ \ \ \ \ \ \ \ //\ class\ HelloWorldFrame |
|
271 |
\ \ \ \ \ \ \ 3:\ dup |
|
272 |
\ \ \ \ \ \ \ 4:\ invokespecial\ #9\ \ \ \ \ \ \ \ //\ Method\ "<init>":()V |
|
273 |
\ \ \ \ \ \ \ 7:\ astore_1 |
|
274 |
\ \ \ \ \ \ \ 8:\ aload_1 |
|
275 |
\ \ \ \ \ \ \ 9:\ iconst_1 |
|
276 |
\ \ \ \ \ \ 10:\ invokevirtual\ #10\ \ \ \ \ \ \ //\ Method\ setVisible:(Z)V |
|
277 |
\ \ \ \ \ \ 13:\ return |
|
278 |
} |
|
279 |
\f[R] |
|
280 |
.fi |