LinuxCommandLibrary

javap

disassembles Java class files

TLDR

Disassemble class file

$ javap [ClassName]
copy
Show bytecode
$ javap -c [ClassName]
copy
Show private members
$ javap -p [ClassName]
copy
Verbose output
$ javap -v [ClassName]
copy
Disassemble from JAR
$ javap -cp [lib.jar] [com.example.Class]
copy
Show line numbers
$ javap -l [ClassName]
copy

SYNOPSIS

javap [options] class...

DESCRIPTION

javap disassembles Java class files. It shows method signatures, fields, and optionally bytecode instructions.
The tool is useful for understanding compiled Java code. It can analyze classes without source code access.

PARAMETERS

CLASS

Class name to disassemble.
-c
Disassemble bytecode.
-p, -private
Show all members.
-v, -verbose
Verbose output.
-l
Show line number tables.
-s
Show internal signatures.
-cp PATH
Classpath for classes.
--help
Display help information.

CAVEATS

Shows compiled code, not source. Part of JDK. Bytecode knowledge helpful.

HISTORY

javap has been part of the JDK since early versions, providing insight into compiled Java bytecode.

SEE ALSO

java(1), javac(1), jad(1), jd-cli(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community