Javap - the Disassembler
Introducing Javap
javap - disassemble one or more class files
options Specifies the command-line options. See Options for javap.
classes Specifies one or more classes separated by spaces to be processed for annotations. You can specify a class that can be found in the class path by its file name, URL, or by its fully qualified class name.
Here are some examples for the specification of classes.
Description
The javap command disassembles one or more class files. The output depends on the options used. When no options are used, the javap command prints the package private, protected and public fields, and methods of the classes passed to it.
The javap command isn’t multirelease JAR aware. Using the class path form of the command results in viewing the base entry in all JAR files, multirelease or not.
Using the URL form, you can use the URL form of an argument to specify a specific version of a class to be disassembled.
The javap command prints its output to stdout.
Options
help, --help, or -?
Prints a help message for the javap command.
-version
Prints release information.
-verbose or -v
Prints additional information about the selected class.
-l
Prints line and local variable tables.
-public
Shows only public classes and members.
-protected
Shows only protected and public classes and members.
-package
Shows package/protected/public classes and members (default).
-private or -p
Shows all classes and members.
-c
Prints disassembled code, for example, the instructions that comprise the Java bytecodes, for each of the methods in the class.
-s
Prints internal type signatures.
-sysinfo
Shows system information (path, size, date, MD5 hash) of the class being processed.
-constants
Shows static final constants.
--module module or -m module
Specifies the module containing classes to be disassembled.
--module-path path
Specifies where to find application modules.
--system jdk
Specifies where to find system modules.
--class-path path, -classpath path, or -cp path
Specifies the path that the javap command uses to find user class files. It overrides the default or the CLASSPATH environment variable when it’s set.
-bootclasspath path
Overrides the location of bootstrap class files.
-Joption
Passes the specified option to the JVM. For example:
Examples
Compile the following HelloWorldFrame class:
The output from the javap HelloWorldFrame.class command yields the following:
The output from the javap -c HelloWorldFrame.class command yields the following:
Last update: September 14, 2021