Java Tool Tutorials - Herong's Tutorial Notes
Dr. Herong Yang, Version 5.10

'javap' - Java Disassembler Command and Options

This section describes what are the commonly used command line options for the Java bytecode class disassembler - 'javap' tool.

"javap": A command line tool that reads Java bytecode class files and disassembles them. "javap" is distributed as part of the Sun JDK package and represented by the \j2sdk1.5.0\bin\javap.exe program file. It has the following syntax:

javap [options] classnames

where "options" is a list of options and "classnames" is a list of Java classe names.

If you want to see the complete list of all options, you can run the "javap" command with the "-help" option:

C:\herong>javap -help

Usage: javap <options> <classes>...

where options include:
 -c                        Disassemble the code
 -classpath <pathlist>     Specify where to find user class files
 -extdirs <dirs>           Override location of installed extensions
 -help                     Print this usage message
 -J<flag>                  Pass <flag> directly to the runtime system
 -l                        Print line number and local variable tables
 -public                   Show only public classes and members
 -protected                Show protected/public classes and members
 -package                  Show package/protected/public classes
                           and members (default)
 -private                  Show all classes and members
 -s                        Print internal type signatures
 -bootclasspath <pathlist> Override location of class files loaded
                           by the bootstrap class loader
 -verbose                  Print stack size, number of locals and args
                           for methods. If verifying, print reasons

Sections in This Chapter

'javap' - Java Disassembler Command and Options

Listing Public Variables and Methods with 'javap'

Listing Private Variables and Methods with 'javap -private'

Disassembling Java Bytecode Class Files with 'javap -c -private'

Looking Up Method Signature with 'javap' Command

Dr. Herong Yang, updated in 2008
'javap' - Java Disassembler Command and Options