Viewing contents of a .jar file Viewing contents of a .jar file java java

Viewing contents of a .jar file


Using the JDK, jar -tf will list the files in the jar. javap will give you more details from a particular class file.


I usually open them with 7-Zip... It allows at least to see packages and classes and resources.
Should I need to see methods or fields, I would use Jad but of course, it is better to rely on (good) JavaDoc...

Now, somewhere on SO was mentioned some Eclipse plug-ins, to find in which jar file a class is located, perhaps they can do more (ie. what you requested).

[EDIT] Reference to SO thread. Not what is asked, but somehow related, thus useful: Java: How do I know which jar file to use given a class name?


What I use personally is JD-GUI. It is a free 'decompiler', as it allows you to see the source code, classes, and objects in the classes, as well as see the file structure in a tree menu to the left. However, it does not allow you to modify the classes directly.

JD-GUI's website: http://jd.benow.ca/