What Is JDK "javap" Command

Q

What Is JDK "javap" Command?

✍: FYIcenter

A

"javap" is a command line tool provided in JDK (Java Development Kit) to help you read Java bytecode class files and disassembles them into JVM (Java Virtual Machine) assembler instructions.

"javap" command has the following syntax:

Usage: javap <options> <classes>
where possible options include:
  --help -help -h -?               Print this help message
  -version                         Version information
  -v  -verbose                     Print additional information
  -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)
  -p  -private                     Show all classes and members
  -c                               Disassemble the code
  -s                               Print internal type signatures
  -sysinfo                         Show system info (path, size, date, SHA-256 hash)
                                   of class being processed
  -constants                       Show final constants
  --module <module>, -m <module>   Specify module containing classes to be disassembled
  -J<vm-option>                    Specify a VM option
  --module-path <path>             Specify where to find application modules
  --system <jdk>                   Specify where to find system modules
  --class-path <path>              Specify where to find user class files
  -classpath <path>                Specify where to find user class files
  -cp <path>                       Specify where to find user class files
  -bootclasspath <path>            Override location of bootstrap class files
  --multi-release <version>        Specify the version to use in multi-release JAR files

GNU-style options may use = instead of whitespace to separate the name of an option
from its value.

Each class to be shown may be specified by a filename, a URL, or by its fully
qualified class name. Examples:
   path/to/MyClass.class
   jar:file:///path/to/MyJar.jar!/mypkg/MyClass.class
   java.lang.Object

 

"javap" - Dedault Output

JDK "javap" Command

JDK "javap" Command

⇑⇑ Java Bytecode Tools

2021-08-21, 806🔥, 0💬