0Pricing
Java Academy · Lesson

Inspecting Bytecode with javap

Decompile class files with javap -c to understand how Java constructs translate to bytecode.

Why Inspect Bytecode?

Understanding bytecode reveals how the JVM actually executes your Java code. It helps debug performance issues, understand compiler optimizations, and verify that synthetic code (lambdas, inner classes) works as expected.

Basic javap Usage

javap ClassName displays the class's public API (method signatures, field declarations). It reads the .class file from the current directory or classpath.

# Compile first:
javac User.java
# Display public API:
javap User
# Output:
# public class User {
#   public java.lang.String getName();
#   public int getAge();
# }

All lessons in this course

  1. Class Loading Phases: Load, Link, Initialize
  2. ClassLoader Hierarchy and Custom Loaders
  3. Inspecting Bytecode with javap
  4. JIT Compilation and Tiered Compilation
← Back to Java Academy