Open the archive
Open the .jar, .war or .ear in Peek.
How-to · Peek Pro
You want to know whether a class is in the build, which methods it has, or who refers to it, and you do not have the source at hand. Both ways below read the compiled classes straight from the archive.
With Peek
The class browser is part of Peek Pro, which you can try free for 14 days.
Open the .jar, .war or .ear in Peek.
Choose Archive ▸ Browse Java Classes…, or Browse Classes… on the archive's panel.
Classes are grouped by package, and the list includes the classes of the JARs the archive bundles, such as those under WEB-INF/lib.
View it as an outline of its fields and methods, or as bytecode. References to other classes are links you can follow.
Search classes, methods, fields and text across the whole archive.
From the Terminal
javap comes with a JDK and reads a class from a JAR on the class path.
# Which classes are in the JAR
unzip -Z1 app.jar | grep '\.class$'
# Members of one class, private ones included
javap -p -cp app.jar com.example.OrderService
# The same with bytecode
javap -p -c -cp app.jar com.example.OrderService
javap does not look inside nested JARs: for a class in a library under WEB-INF/lib you have to extract that library first. It also prints one class at a time, with no search across the archive.
Questions
No. Peek shows declarations and bytecode, the same information javap prints, in a browsable form. It does not reconstruct Java source.
No. Peek has its own class-file reader and does not run Java.
Yes. The classes of the JARs an archive bundles appear in the same browser.
Yes. Search covers classes, methods, fields and text across the archive.
More how-to guides
Free to download
Peek is a native Mac app from the Mac App Store. Nothing is charged when the trial ends; Peek Pro is a one-time purchase, with no subscription and no account.