1javap(1)                    General Commands Manual                   javap(1)
2
3
4

NAME

6       javap - The Java Class File Disassembler
7
8       Disassembles class files.
9

SYNOPSIS

11       javap [ options ] class. . .
12
13

DESCRIPTION

15       The  javap command disassembles a class file. Its output depends on the
16       options used. If no options are used, javap  prints  out  the  package,
17       protected,  and  public fields and methods of the classes passed to it.
18       javap prints its output to stdout. For example, compile  the  following
19       class declaration:
20
21          import java.awt.*;
22          import java.applet.*;
23
24          public class DocFooter extends Applet {
25                  String date;
26                  String email;
27
28                  public void init() {
29                          resize(500,100);
30                          date = getParameter("LAST_UPDATED");
31                          email = getParameter("EMAIL");
32                  }
33
34                  public void paint(Graphics g) {
35                          g.drawString(date + " by ",100, 15);
36                          g.drawString(email,290,15);
37                  }
38          }
39
40
41       The output from javap DocFooter yields:
42
43          Compiled from DocFooter.java
44          public class DocFooter extends java.applet.Applet {
45              java.lang.String date;
46              java.lang.String email;
47              public DocFooter();
48              public void init();
49              public void paint(java.awt.Graphics);
50          }
51
52
53       The output from javap -c DocFooter yields:
54
55          Compiled from DocFooter.java
56          public class DocFooter extends java.applet.Applet {
57              java.lang.String date;
58              java.lang.String email;
59              public DocFooter();
60              public void init();
61              public void paint(java.awt.Graphics);
62          }
63
64          Method DocFooter()
65             0 aload_0
66             1 invokespecial #1 <Method java.applet.Applet()>
67             4 return
68
69          Method void init()
70             0 aload_0
71             1 sipush 500
72             4 bipush 100
73             6 invokevirtual #2 <Method void resize(int, int)>
74             9 aload_0
75            10 aload_0
76            11 ldc #3 <String "LAST_UPDATED">
77            13 invokevirtual #4 <Method java.lang.String getParameter(java.lang.String)>
78            16 putfield #5 <Field java.lang.String date>
79            19 aload_0
80            20 aload_0
81            21 ldc #6 <String "EMAIL">
82            23 invokevirtual #4 <Method java.lang.String getParameter(java.lang.String)>
83            26 putfield #7 <Field java.lang.String email>
84            29 return
85
86          Method void paint(java.awt.Graphics)
87             0 aload_1
88             1 new #8 <Class java.lang.StringBuffer>
89             4 dup
90             5 invokespecial #9 <Method java.lang.StringBuffer()>
91             8 aload_0
92             9 getfield #5 <Field java.lang.String date>
93            12 invokevirtual #10 <Method java.lang.StringBuffer append(java.lang.String)>
94            15 ldc #11 <String " by ">
95            17 invokevirtual #10 <Method java.lang.StringBuffer append(java.lang.String)>
96            20 invokevirtual #12 <Method java.lang.String toString()>
97            23 bipush 100
98            25 bipush 15
99            27 invokevirtual #13 <Method void drawString(java.lang.String, int, int)>
100            30 aload_1
101            31 aload_0
102            32 getfield #7 <Field java.lang.String email>
103            35 sipush 290
104            38 bipush 15
105            40 invokevirtual #13 <Method void drawString(java.lang.String, int, int)>
106            43 return
107
108

OPTIONS

110       -help
111          Prints out help message for javap.
112
113       -l Prints out line and local variable tables.
114
115       -b Ensures backward compatibility with javap in JDK 1.1.
116
117       -public
118          Shows only public classes and members.
119
120       -protected
121          Shows only protected and public classes and members.
122
123       -package
124          Shows  only package, protected, and public classes and members. This
125          is the default.
126
127       -private
128          Shows all classes and members.
129
130       -Jflag
131          Pass flag directly to the runtime system. Some examples:
132
133
134          javap -J-version
135          javap -J-Djava.security.manager -J-Djava.security.policy=MyPolicy MyClassName
136
137       -s Prints internal type signatures.
138
139       -c Prints out disassembled code, i.e., the instructions  that  comprise
140          the  Java bytecodes, for each of the methods in the class. These are
141          documented in the Java Virtual Machine Specification @
142          http://java.sun.com/docs/books/vmspec/.
143
144       -verbose
145          Prints stack size, number of locals and args for methods.
146
147       -classpath path
148          Specifies the path javap uses to look up classes. Overrides the
149          default or the CLASSPATH environment variable if it is set. Directo‐
150          ries are separated by colons. Thus the general format for path is:
151             .:<your_path>
152          For example:
153
154       -bootclasspath path
155          Specifies path from which to load bootstrap classes. By default, the
156          bootstrap classes are the classes implementing the core Java plat‐
157          form located in jre/lib/rt.jar and several other jar files.
158
159       -extdirs dirs
160          Overrides location at which installed extensions are searched for.
161          The default location for extensions is the value of java.ext.dirs.
162

ENVIRONMENT VARIABLES

164       CLASSPATH
165          Used to provide the system a path to user-defined classes. Directo‐
166          ries are separated by colons, for example, For example:
167
168

SEE ALSO

170       javac, java, jdb, javah, javadoc
171
172                                  05 Aug 2006                         javap(1)
Impressum