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