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