Viewing contents of a .jar file

后端 未结 30 936
一向
一向 2020-12-02 03:54

What would be the easiest way to view classes, methods, properties, etc. inside a jar file? I\'m looking for something equivalent to the very useful Lutz Roeder .NET Ref

相关标签:
30条回答
  • 2020-12-02 04:31

    This Jar Explorer is good enough.
    Supports three decompiler types: JD, Procyon and Fernflower.
    Allows to search files and duplicates in any java archive.
    Also user can modify jar by D&D files and edit some non-class files.

    0 讨论(0)
  • 2020-12-02 04:33

    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/

    0 讨论(0)
  • 2020-12-02 04:33

    You can open them with most decompression utilities these days, then just get something like DJ Java Decompiler if you want to view the source.

    0 讨论(0)
  • 2020-12-02 04:34

    Extending Tom Hawtin answer, you can pipe the listing to filter out desired class or files:

    jar tf my-fat-jar-file.jar | grep filename

    This should work on bash/zsh and similars, or emacs' eshell.

    Additional information: https://docs.oracle.com/javase/tutorial/deployment/jar/view.html

    0 讨论(0)
  • 2020-12-02 04:34

    In Eclipse 3.4 do

    1. Drag the jar file in question into a Java project. A copy of the jar file appears.
    2. Right click on the jar file, and choose "Build Path" -> "Add to Build Path".
    3. Jar file is moved to "Referenced Libraries" node, where it can be opened and navigated in the Project Explorer pane.

    If seeing source code too is an issue, open a new question.

    For navigation on Jar-file level (as a zip file) I use 7zip which works very well, and allows seeing and editing entries which is great for trouble shooting.

    0 讨论(0)
  • 2020-12-02 04:34

    I think Java Decomplier is your best option you can download from here: http://jd.benow.ca/

    0 讨论(0)
提交回复
热议问题