Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java class finder Tool

Tags:

java

classpath

Anyone who uses Java regularly knows the amount of trouble multiple jars in classpath can give us. I am looking for a tool which will help me -

  1. Search for class files inside jars in Classpath
  2. Search for class files inside jars in a specific location
  3. Maybe too much to ask for but show me if the same class is present in multiple jars.

Also needless to say it should be fast. Most of the tools i have evaluated are very slow and not upto the mark.

Any tools for the above purpose greatly appreciated.


Currently i use WinRar achieve search(which BTW is really fast) to search for class files inside jars in a specific location. But there is no way to utilize that to search in Classpath.

like image 743
Pushkar Avatar asked Apr 07 '11 07:04

Pushkar


2 Answers

If you use Bash this script may be helpful:

find . -name *.jar -exec bash -c "echo {} && jar tvf {} | grep MyClass" \;
like image 69
fipple Avatar answered Sep 28 '22 18:09

fipple


If you are using eclipse, then IBM's classfinder may be useful. You can perform a (fuzzy) search for a class in a (set of) directories, and get all jar that contains such a class.

Not sure about the classpath option, however.

regards,
Guillaume

like image 41
PATRY Guillaume Avatar answered Sep 28 '22 18:09

PATRY Guillaume