javap.1 revision 1178
4169N/A." Copyright 2002-2006 Sun Microsystems, Inc. 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 Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
2362N/A." CA 95054 USA or visit www.sun.com if you need additional information or
2362N/A." have any questions.
1178N/A."
4169N/A.TH javap 1 "04 May 2009"
0N/A." Generated from HTML by html2man (author: Eric Armstrong)
0N/A
0N/A.LP
4033N/A.SH "Name"
4033N/Ajavap \- The Java Class File Disassembler
0N/A.LP
4033N/A.RS 3
1178N/A
4033N/A.LP
0N/A.LP
4033N/ADisassembles class files.
0N/A.LP
0N/A.RE
4033N/A.SH "SYNOPSIS"
0N/A.LP
0N/A
4033N/A.LP
1178N/A.nf
4033N/A\f3
1178N/A.fl
4033N/Ajavap [ \fP\f3options\fP\f3 ] class. . .
0N/A.fl
0N/A\fP
1178N/A.fi
0N/A
4033N/A.LP
4033N/A.SH "DESCRIPTION"
0N/A.LP
0N/A
0N/A.LP
0N/A.LP
4033N/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:
4033N/A.LP
4033N/A.RS 3
4033N/A
4033N/A.LP
0N/A.nf
0N/A\f3
0N/A.fl
4033N/Aimport java.awt.*;
0N/A.fl
4033N/Aimport java.applet.*;
0N/A.fl
4033N/A
0N/A.fl
4033N/Apublic class DocFooter extends Applet {
4033N/A.fl
4033N/A String date;
1178N/A.fl
4033N/A String email;
0N/A.fl
4033N/A
0N/A.fl
4033N/A public void init() {
0N/A.fl
4033N/A resize(500,100);
0N/A.fl
4033N/A date = getParameter("LAST_UPDATED");
0N/A.fl
4033N/A email = getParameter("EMAIL");
4033N/A.fl
4033N/A }
0N/A.fl
4033N/A
0N/A.fl
4033N/A public void paint(Graphics g) {
0N/A.fl
4033N/A g.drawString(date + " by ",100, 15);
0N/A.fl
4033N/A g.drawString(email,290,15);
0N/A.fl
4033N/A }
1178N/A.fl
4033N/A}
4033N/A.fl
4033N/A\fP
1178N/A.fi
4033N/A.RE
0N/A
4033N/A.LP
0N/A.LP
4033N/AThe output from \f3javap DocFooter\fP yields:
4033N/A.LP
4033N/A.RS 3
0N/A
4033N/A.LP
0N/A.nf
4033N/A\f3
0N/A.fl
4033N/ACompiled from DocFooter.java
0N/A.fl
4033N/Apublic class DocFooter extends java.applet.Applet {
0N/A.fl
4033N/A java.lang.String date;
0N/A.fl
4033N/A java.lang.String email;
0N/A.fl
0N/A public DocFooter();
0N/A.fl
0N/A public void init();
0N/A.fl
4033N/A public void paint(java.awt.Graphics);
0N/A.fl
0N/A}
0N/A.fl
0N/A\fP
4033N/A.fi
0N/A.RE
0N/A
4033N/A.LP
0N/A.LP
0N/AThe output from \f3javap \-c DocFooter\fP yields:
4033N/A.LP
0N/A.RS 3
4033N/A
0N/A.LP
0N/A.nf
4033N/A\f3
0N/A.fl
0N/ACompiled from DocFooter.java
4033N/A.fl
0N/Apublic class DocFooter extends java.applet.Applet {
0N/A.fl
4033N/A java.lang.String date;
0N/A.fl
0N/A java.lang.String email;
4033N/A.fl
0N/A public DocFooter();
0N/A.fl
4033N/A public void init();
0N/A.fl
0N/A public void paint(java.awt.Graphics);
4033N/A.fl
0N/A}
0N/A.fl
4033N/A
0N/A.fl
0N/AMethod DocFooter()
4033N/A.fl
1178N/A 0 aload_0
1178N/A.fl
4033N/A 1 invokespecial #1 <Method java.applet.Applet()>
1178N/A.fl
1178N/A 4 return
4033N/A.fl
0N/A
0N/A.fl
4033N/AMethod void init()
0N/A.fl
0N/A 0 aload_0
4033N/A.fl
0N/A 1 sipush 500
0N/A.fl
4033N/A 4 bipush 100
0N/A.fl
0N/A 6 invokevirtual #2 <Method void resize(int, int)>
4033N/A.fl
0N/A 9 aload_0
0N/A.fl
4033N/A 10 aload_0
0N/A.fl
0N/A 11 ldc #3 <String "LAST_UPDATED">
4033N/A.fl
0N/A 13 invokevirtual #4 <Method java.lang.String getParameter(java.lang.String)>
0N/A.fl
4033N/A 16 putfield #5 <Field java.lang.String date>
0N/A.fl
0N/A 19 aload_0
4033N/A.fl
0N/A 20 aload_0
0N/A.fl
4033N/A 21 ldc #6 <String "EMAIL">
0N/A.fl
0N/A 23 invokevirtual #4 <Method java.lang.String getParameter(java.lang.String)>
4033N/A.fl
1178N/A 26 putfield #7 <Field java.lang.String email>
4033N/A.fl
4033N/A 29 return
0N/A.fl
4033N/A
0N/A.fl
1178N/AMethod void paint(java.awt.Graphics)
4033N/A.fl
4033N/A 0 aload_1
4033N/A.fl
4033N/A 1 new #8 <Class java.lang.StringBuffer>
4033N/A.fl
4033N/A 4 dup
4033N/A.fl
4033N/A 5 invokespecial #9 <Method java.lang.StringBuffer()>
4033N/A.fl
4033N/A 8 aload_0
4033N/A.fl
4033N/A 9 getfield #5 <Field java.lang.String date>
4033N/A.fl
0N/A 12 invokevirtual #10 <Method java.lang.StringBuffer append(java.lang.String)>
0N/A.fl
4033N/A 15 ldc #11 <String " by ">
4033N/A.fl
4033N/A 17 invokevirtual #10 <Method java.lang.StringBuffer append(java.lang.String)>
1178N/A.fl
0N/A 20 invokevirtual #12 <Method java.lang.String toString()>
0N/A.fl
4033N/A 23 bipush 100
0N/A.fl
0N/A 25 bipush 15
4033N/A.fl
0N/A 27 invokevirtual #13 <Method void drawString(java.lang.String, int, int)>
0N/A.fl
4033N/A 30 aload_1
1178N/A.fl
1178N/A 31 aload_0
0N/A.fl
0N/A 32 getfield #7 <Field java.lang.String email>
4033N/A.fl
0N/A 35 sipush 290
0N/A.fl
4033N/A 38 bipush 15
0N/A.fl
0N/A 40 invokevirtual #13 <Method void drawString(java.lang.String, int, int)>
4033N/A.fl
0N/A 43 return
0N/A.fl
0N/A\fP
1178N/A.fi
4033N/A.RE
0N/A
0N/A.LP
0N/A.SH "OPTIONS"
4033N/A.LP
0N/A
0N/A.LP
4033N/A.RS 3
0N/A.TP 3
0N/A\-help
4033N/APrints out help message for \f3javap\fP.
0N/A.TP 3
0N/A\-l
4033N/APrints out line and local variable tables.
0N/A.TP 3
0N/A\-public
1178N/AShows only public classes and members.
4033N/A.TP 3
0N/A\-protected
1178N/AShows only protected and public classes and members.
4033N/A.TP 3
0N/A\-package
1178N/AShows only package, protected, and public classes and members. This is the default.
4033N/A.TP 3
0N/A\-private
0N/AShows all classes and members.
0N/A.TP 3
4033N/A\-Jflag
1178N/APass \f2flag\fP directly to the runtime system. Some examples:
1178N/A.RS 3
1178N/A
1178N/A.LP
4033N/A.nf
1178N/A\f3
4033N/A.fl
1178N/Ajavap \-J\-version
4033N/A.fl
1178N/Ajavap \-J\-Djava.security.manager \-J\-Djava.security.policy=MyPolicy MyClassName
4033N/A.fl
1178N/A\fP
1178N/A.fi
1178N/A.RE
1178N/A.TP 3
1178N/A\-s
4033N/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
0N/A.na
0N/A\f2Java Virtual Machine Specification\fP @
0N/A.fi
http://java.sun.com/docs/books/vmspec/.
.TP 3
\-verbose
Prints stack size, number of \f2locals\fP and \f2args\fP for methods.
.TP 3
\-classpath path
Specifies 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:
.nf
\f3
.fl
.:<your_path>
.fl
\fP
.fi
For example:
.nf
\f3
.fl
.:/home/avh/classes:/usr/local/java/classes
.fl
\fP
.fi
.TP 3
\-bootclasspath path
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.
.TP 3
\-extdirs dirs
Overrides location at which installed extensions are searched for. The default location for extensions is the value of \f2java.ext.dirs\fP.
.RE
.LP
.SH "ENVIRONMENT VARIABLES"
.LP
.LP
.RS 3
.TP 3
CLASSPATH
Used to provide the system a path to user\-defined classes. Directories are separated by colons, for example, For example:
.RS 3
.LP
.nf
\f3
.fl
.:/home/avh/classes:/usr/local/java/classes
.fl
\fP
.fi
.RE
.RE
.LP
.SH "SEE ALSO"
.LP
.LP
.LP
javac(1), java(1), jdb(1), javah(1), javadoc(1)
.LP
.LP