javap
The JDK tool that prints what a class file contains, including its bytecode with -c and its class file version with -v.
In more detail
javap turns the binary class file back into readable text, so you can check what the compiler really produced. In the course it shows the constructor the compiler wrote for you and the major version number, such as 65 for Java 21. It does not reproduce source code.
Examples
javap -c Hello | head -8javap -v Hello | grep majorRelated terms
- class file — The file javac writes for each class, holding that class's bytecode plus a description of its fields and methods.
- bytecode — A compact, portable instruction format that a virtual machine or interpreter executes, instead of instructions for one particular processor.
- class file version — The number stored in every class file that records which Java release it targets, so an older JVM can refuse a file from the future.
Taught in
- The Virtual Machine, The Kit And The Runtime — Modern Java: Virtual Threads & High-Throughput Services
- Release Trains And Long Term Support — Modern Java: Virtual Threads & High-Throughput Services