Viewing contents of a .jar file

后端 未结 30 1043
一向
一向 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条回答
  •  Happy的楠姐
    2020-12-02 04:52

    In case someone don't know this already, a JAR file is just a ZIP file that contains the program's classes, resources, etc., and some metadata. You can extract one to see how it's put together.

    Hence I am using unzip command which is easy to remember and use.

    unzip -l .jar

    For example, if you have a jar file with name test.jar then unzip -l test.jar will list all the content of jar file.

    While all other answers are great, but in most of them, you would have to use some software like 7 zip or JDK or some other eclipse tool while this doesn't require you to have any of these big s/w and it comes by default in linux and mac so its very lightweight and handy to use.

    You can also use zipinfo . if your OS supports this.

提交回复
热议问题