javap.1 revision 4632
4169N/A." Copyright (c) 1994, 2011, Oracle and/or its affiliates. All rights reserved.
1178N/A." DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
1178N/A."
1178N/A." This code is free software; you can redistribute it and/or modify it
1178N/A." under the terms of the GNU General Public License version 2 only, as
1178N/A." published by the Free Software Foundation.
1178N/A."
1178N/A." This code is distributed in the hope that it will be useful, but WITHOUT
1178N/A." ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
1178N/A." FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
1178N/A." version 2 for more details (a copy is included in the LICENSE file that
1178N/A." accompanied this code).
1178N/A."
1178N/A." You should have received a copy of the GNU General Public License version
1178N/A." 2 along with this work; if not, write to the Free Software Foundation,
1178N/A." Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
1178N/A."
2362N/A." Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2362N/A." or visit www.oracle.com if you need additional information or have any
2362N/A." questions.
1178N/A."
4169N/A.TH javap 1 "10 May 2011"
4033N/A
4033N/A.LP
1178N/A.SH "Name"
4033N/Ajavap \- The Java Class File Disassembler
1178N/A.LP
4033N/A.LP
1178N/ADisassembles class files.
4033N/A.LP
1178N/A.SH "SYNOPSIS"
4033N/A.LP
1178N/A.nf
1178N/A\f3
1178N/A.fl
4033N/Ajavap [ \fP\f3options\fP\f3 ] classes
1178N/A.fl
1178N/A\fP
4033N/A.fi
1178N/A
1178N/A.LP
4033N/A.SH "DESCRIPTION"
1178N/A.LP
1178N/A.LP
4033N/AThe \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.
1178N/A.LP
1178N/A.RS 3
4033N/A.TP 3
1178N/Aoptions
1178N/ACommand\-line options.
4033N/A.TP 3
1178N/Aclasses
4033N/AList 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).
1178N/A.RE
4033N/A
1178N/A.LP
0N/A.LP
0N/AFor example, compile the following class declaration:
4033N/A.LP
1178N/A.nf
1178N/A\f3
1178N/A.fl
1178N/Aimport java.awt.*;
1178N/A.fl
1178N/Aimport java.applet.*;
1178N/A.fl
1178N/A
1178N/A.fl
1178N/Apublic class DocFooter extends Applet {
1178N/A.fl
1178N/A String date;
1178N/A.fl
1178N/A String email;
1178N/A.fl
1178N/A
1178N/A.fl
1178N/A public void init() {
0N/A.fl
0N/A resize(500,100);
4033N/A.fl
0N/A date = getParameter("LAST_UPDATED");
0N/A.fl
0N/A email = getParameter("EMAIL");
0N/A.fl
0N/A }
0N/A.fl
0N/A
0N/A.fl
4033N/A public void paint(Graphics g) {
0N/A.fl
0N/A g.drawString(date + " by ",100, 15);
1178N/A.fl
1178N/A g.drawString(email,290,15);
1178N/A.fl
1178N/A }
1178N/A.fl
1178N/A}
1178N/A.fl
1178N/A\fP
1178N/A.fi
1178N/A
1178N/A.LP
1178N/A.LP
1178N/AThe output from \f3javap DocFooter.class\fP yields:
1178N/A.LP
1178N/A.nf
1178N/A\f3
1178N/A.fl
1178N/ACompiled from "DocFooter.java"
1178N/A.fl
1178N/Apublic class DocFooter extends java.applet.Applet {
1178N/A.fl
1178N/A java.lang.String date;
1178N/A.fl
1178N/A java.lang.String email;
1178N/A.fl
1178N/A public DocFooter();
1178N/A.fl
4033N/A public void init();
1178N/A.fl
1178N/A public void paint(java.awt.Graphics);
1178N/A.fl
1178N/A}
1178N/A.fl
1178N/A\fP
1178N/A.fi
1178N/A
1178N/A.LP
1178N/A.LP
1178N/AThe output from \f3javap \-c DocFooter.class\fP yields:
1178N/A.LP
1178N/A.nf
1178N/A\f3
1178N/A.fl
4033N/ACompiled from "DocFooter.java"
1178N/A.fl
1178N/Apublic class DocFooter extends java.applet.Applet {
1178N/A.fl
1178N/A java.lang.String date;
1178N/A.fl
1178N/A
1178N/A.fl
1178N/A java.lang.String email;
1178N/A.fl
1178N/A
1178N/A.fl
1178N/A public DocFooter();
1178N/A.fl
1178N/A Code:
1178N/A.fl
4033N/A 0: aload_0
1178N/A.fl
1178N/A 1: invokespecial #1 // Method java/applet/Applet."<init>":()V
1178N/A.fl
1178N/A 4: return
1178N/A.fl
1178N/A
1178N/A.fl
1178N/A public void init();
1178N/A.fl
1178N/A Code:
1178N/A.fl
1178N/A 0: aload_0
1178N/A.fl
1178N/A 1: sipush 500
1178N/A.fl
4033N/A 4: bipush 100
1178N/A.fl
4033N/A 6: invokevirtual #2 // Method resize:(II)V
1178N/A.fl
4033N/A 9: aload_0
1178N/A.fl
1178N/A 10: aload_0
1178N/A.fl
1178N/A 11: ldc #3 // String LAST_UPDATED
1178N/A.fl
1178N/A 13: invokevirtual #4 // Method getParameter:(Ljava/lang/String;)Ljava/lang/String;
1178N/A.fl
1178N/A 16: putfield #5 // Field date:Ljava/lang/String;
1178N/A.fl
1178N/A 19: aload_0
1178N/A.fl
1178N/A 20: aload_0
1178N/A.fl
1178N/A 21: ldc #6 // String EMAIL
1178N/A.fl
4033N/A 23: invokevirtual #4 // Method getParameter:(Ljava/lang/String;)Ljava/lang/String;
1178N/A.fl
1178N/A 26: putfield #7 // Field email:Ljava/lang/String;
1178N/A.fl
1178N/A 29: return
1178N/A.fl
1178N/A
1178N/A.fl
1178N/A public void paint(java.awt.Graphics);
1178N/A.fl
1178N/A Code:
1178N/A.fl
1178N/A 0: aload_1
1178N/A.fl
1178N/A 1: new #8 // class java/lang/StringBuilder
1178N/A.fl
4033N/A 4: dup
1178N/A.fl
1178N/A 5: invokespecial #9 // Method java/lang/StringBuilder."<init>":()V
1178N/A.fl
1178N/A 8: aload_0
1178N/A.fl
1178N/A 9: getfield #5 // Field date:Ljava/lang/String;
1178N/A.fl
1178N/A 12: invokevirtual #10 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
1178N/A.fl
1178N/A 15: ldc #11 // String by
1178N/A.fl
1178N/A 17: invokevirtual #10 // Method java/lang/StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
1178N/A.fl
1178N/A 20: invokevirtual #12 // Method java/lang/StringBuilder.toString:()Ljava/lang/String;
1178N/A.fl
1178N/A 23: bipush 100
1178N/A.fl
1178N/A 25: bipush 15
1178N/A.fl
1178N/A 27: invokevirtual #13 // Method java/awt/Graphics.drawString:(Ljava/lang/String;II)V
1178N/A.fl
1178N/A 30: aload_1
1178N/A.fl
1178N/A 31: aload_0
1178N/A.fl
1178N/A 32: getfield #7 // Field email:Ljava/lang/String;
1178N/A.fl
1178N/A 35: sipush 290
1178N/A.fl
1178N/A 38: bipush 15
1178N/A.fl
4033N/A 40: invokevirtual #13 // Method java/awt/Graphics.drawString:(Ljava/lang/String;II)V
1178N/A.fl
1178N/A 43: return
1178N/A.fl
1178N/A}
1178N/A.fl
1178N/A\fP
1178N/A.fi
1178N/A
1178N/A.LP
1178N/A.SH "OPTIONS"
1178N/A.LP
1178N/A.RS 3
1178N/A.TP 3
1178N/A\-help \-\-help \-?
1178N/APrints out help message for \f3javap\fP.
4033N/A.TP 3
1178N/A\-version
1178N/APrints out version information.
1178N/A.TP 3
1178N/A\-l
1178N/APrints out line and local variable tables.
1178N/A.TP 3
1178N/A\-public
1178N/AShows only public classes and members.
1178N/A.TP 3
1178N/A\-protected
1178N/AShows only protected and public classes and members.
1178N/A.TP 3
1178N/A\-package
1178N/AShows only package, protected, and public classes and members. This is the default.
1178N/A.TP 3
4033N/A\-private \-p
1178N/AShows all classes and members.
1178N/A.TP 3
1178N/A\-Jflag
1178N/APass \f2flag\fP directly to the runtime system. Some examples:
1178N/A.nf
1178N/A\f3
1178N/A.fl
1178N/Ajavap \-J\-version
1178N/A.fl
1178N/Ajavap \-J\-Djava.security.manager \-J\-Djava.security.policy=MyPolicy MyClassName
1178N/A.fl
1178N/A\fP
1178N/A.fi
1178N/A.TP 3
1178N/A\-s
4033N/APrints internal type signatures.
1178N/A.TP 3
1178N/A\-sysinfo
1178N/AShows system information (path, size, date, MD5 hash) of the class being processed.
1178N/A.TP 3
1178N/A\-constants
1178N/AShows static final constants.
1178N/A.TP 3
1178N/A\-c
1178N/APrints 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
1178N/A.na
1178N/A\f2Java Virtual Machine Specification\fP @
1178N/A.fi
1178N/Ahttp://java.sun.com/docs/books/vmspec/.
1178N/A.TP 3
1178N/A\-verbose
4033N/APrints stack size, number of \f2locals\fP and \f2args\fP for methods.
1178N/A.TP 3
1178N/A\-classpath path
1178N/ASpecifies the path \f3javap\fP uses to look up classes. Overrides the default or the CLASSPATH environment variable if it is set.
1178N/A.TP 3
1178N/A\-bootclasspath path
1178N/ASpecifies 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.
1178N/A.TP 3
1178N/A\-extdirs dirs
1178N/AOverrides location at which installed extensions are searched for. The default location for extensions is the value of \f2java.ext.dirs\fP.
1178N/A.RE
1178N/A
1178N/A.LP
1178N/A.SH "SEE ALSO"
1178N/A.LP
1178N/A.LP
4033N/Ajavac(1), java(1), jdb(1), javah(1), javadoc(1)
1178N/A.LP
1178N/A
1178N/A