Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get method signatures from a jar file?

I have a third-party jar file that comes with the javadocs for only part of the API. Is there a way to reverse engineer the jar file to obtain a complete listing of classes and methods?

like image 326
MCS Avatar asked Jun 10 '09 15:06

MCS


1 Answers

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.

like image 191
Tom Hawtin - tackline Avatar answered Sep 21 '22 16:09

Tom Hawtin - tackline