annotate src/bsd/doc/man/javap.1 @ 6581:cea72c2bf071

7197491: update copyright year to match last edit in jdk8 jdk repository Reviewed-by: chegar, ksrini
author alanb
date Fri, 02 Nov 2012 15:50:11 +0000
parents d45bc4307996
children
rev   line source
alanb@6581 1 ." Copyright (c) 1994, 2012, Oracle and/or its affiliates. All rights reserved.
michaelm@5177 2 ." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
michaelm@5177 3 ."
michaelm@5177 4 ." This code is free software; you can redistribute it and/or modify it
michaelm@5177 5 ." under the terms of the GNU General Public License version 2 only, as
michaelm@5177 6 ." published by the Free Software Foundation.
michaelm@5177 7 ."
michaelm@5177 8 ." This code is distributed in the hope that it will be useful, but WITHOUT
michaelm@5177 9 ." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
michaelm@5177 10 ." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
michaelm@5177 11 ." version 2 for more details (a copy is included in the LICENSE file that
michaelm@5177 12 ." accompanied this code).
michaelm@5177 13 ."
michaelm@5177 14 ." You should have received a copy of the GNU General Public License version
michaelm@5177 15 ." 2 along with this work; if not, write to the Free Software Foundation,
michaelm@5177 16 ." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
michaelm@5177 17 ."
michaelm@5177 18 ." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
michaelm@5177 19 ." or visit www.oracle.com if you need additional information or have any
michaelm@5177 20 ." questions.
michaelm@5177 21 ."
michaelm@5177 22 .TH javap 1 "10 May 2011"
michaelm@5177 23
michaelm@5177 24 .LP
michaelm@5177 25 .SH "Name"
michaelm@5177 26 javap \- The Java Class File Disassembler
michaelm@5177 27 .LP
michaelm@5177 28 .LP
michaelm@5177 29 Disassembles class files.
michaelm@5177 30 .LP
michaelm@5177 31 .SH "SYNOPSIS"
michaelm@5177 32 .LP
michaelm@5177 33 .nf
michaelm@5177 34 \f3
michaelm@5177 35 .fl
michaelm@5177 36 javap [ \fP\f3options\fP\f3 ] classes
michaelm@5177 37 .fl
michaelm@5177 38 \fP
michaelm@5177 39 .fi
michaelm@5177 40
michaelm@5177 41 .LP
michaelm@5177 42 .SH "DESCRIPTION"
michaelm@5177 43 .LP
michaelm@5177 44 .LP
michaelm@5177 45 The \f3javap\fP command disassembles one or more class files. Its output depends on the options used. If no options are used, \f3javap\fP prints out the package, protected, and public fields and methods of the classes passed to it. \f3javap\fP prints its output to stdout.
michaelm@5177 46 .LP
michaelm@5177 47 .RS 3
michaelm@5177 48 .TP 3
michaelm@5177 49 options
michaelm@5177 50 Command\-line options.
michaelm@5177 51 .TP 3
michaelm@5177 52 classes
michaelm@5177 53 List of one or more classes (separated by spaces) to be processed for annotations (such as \f2DocFooter.class\fP). You may specify a class that can be found in the class path, by its file name (for example, \f2/home/user/myproject/src/DocFooter.class\fP), or with a URL (for example, \f2file:///home/user/myproject/src/DocFooter.class\fP).
michaelm@5177 54 .RE
michaelm@5177 55
michaelm@5177 56 .LP
michaelm@5177 57 .LP
michaelm@5177 58 For example, compile the following class declaration:
michaelm@5177 59 .LP
michaelm@5177 60 .nf
michaelm@5177 61 \f3
michaelm@5177 62 .fl
michaelm@5177 63 import java.awt.*;
michaelm@5177 64 .fl
michaelm@5177 65 import java.applet.*;
michaelm@5177 66 .fl
michaelm@5177 67
michaelm@5177 68 .fl
michaelm@5177 69 public class DocFooter extends Applet {
michaelm@5177 70 .fl
michaelm@5177 71 String date;
michaelm@5177 72 .fl
michaelm@5177 73 String email;
michaelm@5177 74 .fl
michaelm@5177 75
michaelm@5177 76 .fl
michaelm@5177 77 public void init() {
michaelm@5177 78 .fl
michaelm@5177 79 resize(500,100);
michaelm@5177 80 .fl
michaelm@5177 81 date = getParameter("LAST_UPDATED");
michaelm@5177 82 .fl
michaelm@5177 83 email = getParameter("EMAIL");
michaelm@5177 84 .fl
michaelm@5177 85 }
michaelm@5177 86 .fl
michaelm@5177 87
michaelm@5177 88 .fl
michaelm@5177 89 public void paint(Graphics g) {
michaelm@5177 90 .fl
michaelm@5177 91 g.drawString(date + " by ",100, 15);
michaelm@5177 92 .fl
michaelm@5177 93 g.drawString(email,290,15);
michaelm@5177 94 .fl
michaelm@5177 95 }
michaelm@5177 96 .fl
michaelm@5177 97 }
michaelm@5177 98 .fl
michaelm@5177 99 \fP
michaelm@5177 100 .fi
michaelm@5177 101
michaelm@5177 102 .LP
michaelm@5177 103 .LP
michaelm@5177 104 The output from \f3javap DocFooter.class\fP yields:
michaelm@5177 105 .LP
michaelm@5177 106 .nf
michaelm@5177 107 \f3
michaelm@5177 108 .fl
michaelm@5177 109 Compiled from "DocFooter.java"
michaelm@5177 110 .fl
michaelm@5177 111 public class DocFooter extends java.applet.Applet {
michaelm@5177 112 .fl
michaelm@5177 113 java.lang.String date;
michaelm@5177 114 .fl
michaelm@5177 115 java.lang.String email;
michaelm@5177 116 .fl
michaelm@5177 117 public DocFooter();
michaelm@5177 118 .fl
michaelm@5177 119 public void init();
michaelm@5177 120 .fl
michaelm@5177 121 public void paint(java.awt.Graphics);
michaelm@5177 122 .fl
michaelm@5177 123 }
michaelm@5177 124 .fl
michaelm@5177 125 \fP
michaelm@5177 126 .fi
michaelm@5177 127
michaelm@5177 128 .LP
michaelm@5177 129 .LP
michaelm@5177 130 The output from \f3javap \-c DocFooter.class\fP yields:
michaelm@5177 131 .LP
michaelm@5177 132 .nf
michaelm@5177 133 \f3
michaelm@5177 134 .fl
michaelm@5177 135 Compiled from "DocFooter.java"
michaelm@5177 136 .fl
michaelm@5177 137 public class DocFooter extends java.applet.Applet {
michaelm@5177 138 .fl
michaelm@5177 139 java.lang.String date;
michaelm@5177 140 .fl
michaelm@5177 141
michaelm@5177 142 .fl
michaelm@5177 143 java.lang.String email;
michaelm@5177 144 .fl
michaelm@5177 145
michaelm@5177 146 .fl
michaelm@5177 147 public DocFooter();
michaelm@5177 148 .fl
michaelm@5177 149 Code:
michaelm@5177 150 .fl
michaelm@5177 151 0: aload_0
michaelm@5177 152 .fl
michaelm@5177 153 1: invokespecial #1 // Method java/applet/Applet."<init>":()V
michaelm@5177 154 .fl
michaelm@5177 155 4: return
michaelm@5177 156 .fl
michaelm@5177 157
michaelm@5177 158 .fl
michaelm@5177 159 public void init();
michaelm@5177 160 .fl
michaelm@5177 161 Code:
michaelm@5177 162 .fl
michaelm@5177 163 0: aload_0
michaelm@5177 164 .fl
michaelm@5177 165 1: sipush 500
michaelm@5177 166 .fl
michaelm@5177 167 4: bipush 100
michaelm@5177 168 .fl
michaelm@5177 169 6: invokevirtual #2 // Method resize:(II)V
michaelm@5177 170 .fl
michaelm@5177 171 9: aload_0
michaelm@5177 172 .fl
michaelm@5177 173 10: aload_0
michaelm@5177 174 .fl
michaelm@5177 175 11: ldc #3 // String LAST_UPDATED
michaelm@5177 176 .fl
michaelm@5177 177 13: invokevirtual #4 // Method getParameter:(Ljava/lang/String;)Ljava/lang/String;
michaelm@5177 178 .fl
michaelm@5177 179 16: putfield #5 // Field date:Ljava/lang/String;
michaelm@5177 180 .fl
michaelm@5177 181 19: aload_0
michaelm@5177 182 .fl
michaelm@5177 183 20: aload_0
michaelm@5177 184 .fl
michaelm@5177 185 21: ldc #6 // String EMAIL
michaelm@5177 186 .fl
michaelm@5177 187 23: invokevirtual #4 // Method getParameter:(Ljava/lang/String;)Ljava/lang/String;
michaelm@5177 188 .fl
michaelm@5177 189 26: putfield #7 // Field email:Ljava/lang/String;
michaelm@5177 190 .fl
michaelm@5177 191 29: return
michaelm@5177 192 .fl
michaelm@5177 193
michaelm@5177 194 .fl
michaelm@5177 195 public void paint(java.awt.Graphics);
michaelm@5177 196 .fl
michaelm@5177 197 Code:
michaelm@5177 198 .fl
michaelm@5177 199 0: aload_1
michaelm@5177 200 .fl
michaelm@5177 201 1: new #8 // class java/lang/StringBuilder
michaelm@5177 202 .fl
michaelm@5177 203 4: dup
michaelm@5177 204 .fl
michaelm@5177 205 5: invokespecial #9 // Method java/lang/StringBuilder."<init>":()V
michaelm@5177 206 .fl
michaelm@5177 207 8: aload_0
michaelm@5177 208 .fl
michaelm@5177 209 9: getfield #5 // Field date:Ljava/lang/String;
michaelm@5177 210 .fl
michaelm@5177 211 12: invokevirtual #10 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
michaelm@5177 212 .fl
michaelm@5177 213 15: ldc #11 // String by
michaelm@5177 214 .fl
michaelm@5177 215 17: invokevirtual #10 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
michaelm@5177 216 .fl
michaelm@5177 217 20: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
michaelm@5177 218 .fl
michaelm@5177 219 23: bipush 100
michaelm@5177 220 .fl
michaelm@5177 221 25: bipush 15
michaelm@5177 222 .fl
michaelm@5177 223 27: invokevirtual #13 // Method java/awt/Graphics.drawString:(Ljava/lang/String;II)V
michaelm@5177 224 .fl
michaelm@5177 225 30: aload_1
michaelm@5177 226 .fl
michaelm@5177 227 31: aload_0
michaelm@5177 228 .fl
michaelm@5177 229 32: getfield #7 // Field email:Ljava/lang/String;
michaelm@5177 230 .fl
michaelm@5177 231 35: sipush 290
michaelm@5177 232 .fl
michaelm@5177 233 38: bipush 15
michaelm@5177 234 .fl
michaelm@5177 235 40: invokevirtual #13 // Method java/awt/Graphics.drawString:(Ljava/lang/String;II)V
michaelm@5177 236 .fl
michaelm@5177 237 43: return
michaelm@5177 238 .fl
michaelm@5177 239 }
michaelm@5177 240 .fl
michaelm@5177 241 \fP
michaelm@5177 242 .fi
michaelm@5177 243
michaelm@5177 244 .LP
michaelm@5177 245 .SH "OPTIONS"
michaelm@5177 246 .LP
michaelm@5177 247 .RS 3
michaelm@5177 248 .TP 3
michaelm@5177 249 \-help \-\-help \-?
michaelm@5177 250 Prints out help message for \f3javap\fP.
michaelm@5177 251 .TP 3
michaelm@5177 252 \-version
michaelm@5177 253 Prints out version information.
michaelm@5177 254 .TP 3
michaelm@5177 255 \-l
michaelm@5177 256 Prints out line and local variable tables.
michaelm@5177 257 .TP 3
michaelm@5177 258 \-public
michaelm@5177 259 Shows only public classes and members.
michaelm@5177 260 .TP 3
michaelm@5177 261 \-protected
michaelm@5177 262 Shows only protected and public classes and members.
michaelm@5177 263 .TP 3
michaelm@5177 264 \-package
michaelm@5177 265 Shows only package, protected, and public classes and members. This is the default.
michaelm@5177 266 .TP 3
michaelm@5177 267 \-private \-p
michaelm@5177 268 Shows all classes and members.
michaelm@5177 269 .TP 3
michaelm@5177 270 \-Jflag
michaelm@5177 271 Pass \f2flag\fP directly to the runtime system. Some examples:
michaelm@5177 272 .nf
michaelm@5177 273 \f3
michaelm@5177 274 .fl
michaelm@5177 275 javap \-J\-version
michaelm@5177 276 .fl
michaelm@5177 277 javap \-J\-Djava.security.manager \-J\-Djava.security.policy=MyPolicy MyClassName
michaelm@5177 278 .fl
michaelm@5177 279 \fP
michaelm@5177 280 .fi
michaelm@5177 281 .TP 3
michaelm@5177 282 \-s
michaelm@5177 283 Prints internal type signatures.
michaelm@5177 284 .TP 3
michaelm@5177 285 \-sysinfo
michaelm@5177 286 Shows system information (path, size, date, MD5 hash) of the class being processed.
michaelm@5177 287 .TP 3
michaelm@5177 288 \-constants
michaelm@5177 289 Shows static final constants.
michaelm@5177 290 .TP 3
michaelm@5177 291 \-c
michaelm@5177 292 Prints out disassembled code, i.e., the instructions that comprise the Java bytecodes, for each of the methods in the class. These are documented in the
michaelm@5177 293 .na
michaelm@5177 294 \f2Java Virtual Machine Specification\fP @
michaelm@5177 295 .fi
michaelm@5177 296 http://java.sun.com/docs/books/vmspec/.
michaelm@5177 297 .TP 3
michaelm@5177 298 \-verbose
michaelm@5177 299 Prints stack size, number of \f2locals\fP and \f2args\fP for methods.
michaelm@5177 300 .TP 3
michaelm@5177 301 \-classpath path
michaelm@5177 302 Specifies the path \f3javap\fP uses to look up classes. Overrides the default or the CLASSPATH environment variable if it is set.
michaelm@5177 303 .TP 3
michaelm@5177 304 \-bootclasspath path
michaelm@5177 305 Specifies path from which to load bootstrap classes. By default, the bootstrap classes are the classes implementing the core Java platform located in \f2jre/lib/rt.jar\fP and several other jar files.
michaelm@5177 306 .TP 3
michaelm@5177 307 \-extdirs dirs
michaelm@5177 308 Overrides location at which installed extensions are searched for. The default location for extensions is the value of \f2java.ext.dirs\fP.
michaelm@5177 309 .RE
michaelm@5177 310
michaelm@5177 311 .LP
michaelm@5177 312 .SH "SEE ALSO"
michaelm@5177 313 .LP
michaelm@5177 314 .LP
michaelm@5177 315 javac(1), java(1), jdb(1), javah(1), javadoc(1)
michaelm@5177 316 .LP
michaelm@5177 317