I am looking for a tool where I can search several jar, war, ... files for a certain class and method (even better Signature).
So far I have found tools such as JavaClassFinder where I can search for java files and classes. What I would need is to search for methods / signatures as well... I am looking for an existing solution, I do not want to write my own tool.
Example: MyMethod should find all MyMethod methods
Any ideas, suggestions?
---- Edit 2014/March -----
See https://stackoverflow.com/a/23112227/356726
The, the idea is to use find on the root of your classpath to locate all jars, then runs findclass.sh on all found jars to look for a match. It doesn't handle multi-directories, but if you carefully choose the root you can get it to work.
You can use Java jar tool. List the content of jar file in a txt file and you can see all the classes in the jar. Also, this won't allow you to inspect annotations, which is likely something you'll want to do if you're scanning classes at runtime.
Ctrl + H will bring up a Search/Find dialog. One of the tabs is Java which will let you specify what exactly you are looking for e.g. Class/MNethod etc.
I don't know about a standalone tool, but if you create a simple Java project in Eclipse and add the jar, war, etc files to that, you can use the "Java Search" search dialog in Eclipse.
This does exactly what your want and among others has an option to search for methods, and even allows you to filter those on references or declarations.
Alternatively you do have to build something yourself, although you could always use an existing tool as a start, like JavaClassFinder you mentioned or JBoss Tattletale.
I just wrote a small (OpenSource) text search utility for JAVA archive files. It can cover your requirement to some extend.
EAR Search can be downloaded from http://sourceforge.net/projects/earsearch
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With