8

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

Community
  • 1
  • 1
Horst Walter
  • 13,663
  • 32
  • 126
  • 228

3 Answers3

6

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.

Sean Patrick Floyd
  • 292,901
  • 67
  • 465
  • 588
Arjan Tijms
  • 37,782
  • 12
  • 108
  • 140
  • I had somehow the same idea to do it in eclipse. Only thing is, if I frequently have to do this, always setting up a dummy Eclipse project is tedious. I certainly will do it if I find no tool - so thanks a lot. – Horst Walter Jan 01 '11 at 19:55
2

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

guitoo
  • 21
  • 1
  • Is there a tutorial on how to use it? – Fahad Ishaque May 10 '16 at 10:27
  • good tool! Nice post for a pretty new member! One thing: IF you still maintain this tool, could you add the possibility to exclude specific subdirectories? I would not alway want the 'libs' folder searched, where only external libraries are.. – Dominik Reinert Mar 17 '17 at 09:49
1

By chance another comitter in another question has left a link to http://code.google.com/p/reflections/ (honour to this link). THis would help if you need to do this at runtime.

Community
  • 1
  • 1
mtraut
  • 4,720
  • 3
  • 24
  • 33
  • Yep, I found some of the runtime solutions as well. Actually I want to just use it as a tool and find some methods in given jars. Thanks anyway, i appreciate your input – Horst Walter Jan 01 '11 at 19:53