javap.1 revision 2362
1178N/A." Copyright 2002-2006 Sun Microsystems, Inc. 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."
1178N/A.TH javap 1 "04 May 2009"
1178N/A." Generated from HTML by html2man (author: Eric Armstrong)
1178N/A
1178N/A.LP
1178N/A.SH "Name"
1178N/Ajavap \- The Java Class File Disassembler
1178N/A.LP
1178N/A.RS 3
1178N/A
1178N/A.LP
1178N/A.LP
1178N/ADisassembles class files.
1178N/A.LP
1178N/A.RE
1178N/A.SH "SYNOPSIS"
1178N/A.LP
1178N/A
1178N/A.LP
1178N/A.nf
1178N/A\f3
1178N/A.fl
1178N/Ajavap [ \fP\f3options\fP\f3 ] class. . .
1178N/A.fl
1178N/A\fP
1178N/A.fi
1178N/A
1178N/A.LP
1178N/A.SH "DESCRIPTION"
1178N/A.LP
1178N/A
1178N/A.LP
1178N/A.LP
1178N/AThe \f3javap\fP command disassembles a class file. 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. For example, compile the following class declaration:
1178N/A.LP
1178N/A.RS 3
1178N/A
0N/A.LP
0N/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() {
1178N/A.fl
1178N/A resize(500,100);
0N/A.fl
0N/A date = getParameter("LAST_UPDATED");
1178N/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
1178N/A g.drawString(date + " by ",100, 15);
0N/A.fl
0N/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.RE
1178N/A
1178N/A.LP
1178N/A.LP
1178N/AThe output from \f3javap DocFooter\fP yields:
1178N/A.LP
1178N/A.RS 3
1178N/A
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
1178N/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.RE
1178N/A
1178N/A.LP
1178N/A.LP
1178N/AThe output from \f3javap \-c DocFooter\fP yields:
1178N/A.LP
1178N/A.RS 3
1178N/A
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
1178N/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
1178N/A.fl
1178N/AMethod DocFooter()
1178N/A.fl
1178N/A 0 aload_0
1178N/A.fl
1178N/A 1 invokespecial #1 <Method java.applet.Applet()>
1178N/A.fl
1178N/A 4 return
1178N/A.fl
1178N/A
1178N/A.fl
1178N/AMethod void init()
1178N/A.fl
1178N/A 0 aload_0
1178N/A.fl
1178N/A 1 sipush 500
1178N/A.fl
1178N/A 4 bipush 100
1178N/A.fl
1178N/A 6 invokevirtual #2 <Method void resize(int, int)>
1178N/A.fl
1178N/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 java.lang.String getParameter(java.lang.String)>
1178N/A.fl
1178N/A 16 putfield #5 <Field java.lang.String date>
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
1178N/A 23 invokevirtual #4 <Method java.lang.String getParameter(java.lang.String)>
1178N/A.fl
1178N/A 26 putfield #7 <Field java.lang.String email>
1178N/A.fl
1178N/A 29 return
1178N/A.fl
1178N/A
1178N/A.fl
1178N/AMethod void paint(java.awt.Graphics)
1178N/A.fl
1178N/A 0 aload_1
1178N/A.fl
1178N/A 1 new #8 <Class java.lang.StringBuffer>
1178N/A.fl
1178N/A 4 dup
1178N/A.fl
1178N/A 5 invokespecial #9 <Method java.lang.StringBuffer()>
1178N/A.fl
1178N/A 8 aload_0
1178N/A.fl
1178N/A 9 getfield #5 <Field java.lang.String date>
1178N/A.fl
1178N/A 12 invokevirtual #10 <Method java.lang.StringBuffer append(java.lang.String)>
1178N/A.fl
1178N/A 15 ldc #11 <String " by ">
1178N/A.fl
1178N/A 17 invokevirtual #10 <Method java.lang.StringBuffer append(java.lang.String)>
1178N/A.fl
1178N/A 20 invokevirtual #12 <Method java.lang.String toString()>
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 void drawString(java.lang.String, int, int)>
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 java.lang.String email>
1178N/A.fl
1178N/A 35 sipush 290
1178N/A.fl
1178N/A 38 bipush 15
1178N/A.fl
1178N/A 40 invokevirtual #13 <Method void drawString(java.lang.String, int, int)>
1178N/A.fl
1178N/A 43 return
1178N/A.fl
1178N/A\fP
1178N/A.fi
1178N/A.RE
1178N/A
1178N/A.LP
1178N/A.SH "OPTIONS"
1178N/A.LP
1178N/A
1178N/A.LP
1178N/A.RS 3
1178N/A.TP 3
1178N/A\-help
1178N/APrints out help message for \f3javap\fP.
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
1178N/A\-private
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.RS 3
1178N/A
1178N/A.LP
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.RE
1178N/A.TP 3
1178N/A\-s
1178N/APrints internal type signatures.
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
1178N/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. Directories are separated by colons. Thus the general format for \f2path\fP is:
1178N/A.nf
1178N/A\f3
1178N/A.fl
1178N/A .:<your_path>
1178N/A.fl
1178N/A\fP
1178N/A.fi
1178N/AFor example:
1178N/A.nf
1178N/A\f3
1178N/A.fl
1178N/A.:/home/avh/classes:/usr/local/java/classes
1178N/A.fl
1178N/A\fP
1178N/A.fi
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 "ENVIRONMENT VARIABLES"
1178N/A.LP
1178N/A
1178N/A.LP
1178N/A.RS 3
1178N/A.TP 3
1178N/ACLASSPATH
1178N/AUsed to provide the system a path to user\-defined classes. Directories are separated by colons, for example, For example:
1178N/A.RS 3
1178N/A
1178N/A.LP
1178N/A.nf
1178N/A\f3
1178N/A.fl
1178N/A.:/home/avh/classes:/usr/local/java/classes
1178N/A.fl
1178N/A\fP
1178N/A.fi
1178N/A.RE
1178N/A.RE
1178N/A
1178N/A.LP
1178N/A.SH "SEE ALSO"
1178N/A.LP
1178N/A
1178N/A.LP
1178N/A.LP
1178N/Ajavac(1), java(1), jdb(1), javah(1), javadoc(1)
1178N/A.LP
1178N/A
1178N/A.LP
1178N/A
1178N/A