How to get method signatures from a jar file? How to get method signatures from a jar file? java java

How to get method signatures from a jar file?


jar tf will list the contents for you. javap will allow you to see more details of the classes (see the tools guide).

For instance if you have a class named mypkg.HelloWorld in a jar myjar.jar then run it like

javap -classpath myjar.jar mypkg.HelloWorld

However, are you sure you want to be using these unpublished APIs? It's usually a really bad idea.


As Scott said, you can use Eclipse to get a lot of what you're looking for.

I would recommend getting the JadClipse plugin which will decompile the .class files on the fly and show you actual Java code as you browse the classes in the IDE.


If you're using eclipse, you can just add it to a project's classpath and explore it using the treeview and/or content assist.

I'd assume other IDEs can do similar.

From a command-line point of view, you can unjar it (jar xf foo.jar) and use javap against all files.