10

I need to know TimedWindowEvent class belongs to which JAR when JDK/JRE is downloaded. Is there any generalized way of searching Jar to which a particular class belongs to using Eclipse or any other tool. Right now, I have to open jar in WinRAR and go through each and every jar to find if class I am searching for is present there.

Mark Rotteveel
  • 100,966
  • 191
  • 140
  • 197
Aman J
  • 1,825
  • 1
  • 16
  • 30
  • 1
    jar vtf jarFile.jar list content of a jar, depending on which OS you're running you can write a simple script doing this. – BigMike Dec 19 '12 at 11:18
  • 1
    http://stackoverflow.com/questions/7468712/how-to-find-out-which-dependency-a-class-belongs-to – Renjith Dec 19 '12 at 11:20
  • Include all possible jars to ur eclipse project dependencies. Then use the option Navigate->Open Type.... and type in the required classname to search for it. – Kiran Mohan Dec 19 '12 at 11:25

5 Answers5

8

In eclipse you could use ctrl+shift+t (That's means you are searching on targets ) it will popup a window and put your class name. It will show you jars that class name belongs to.

someone
  • 6,577
  • 7
  • 37
  • 60
7

You could start by searching for the class on JarFinder.

http://www.findjar.com/

Not perfect as sometimes a class is in more than one JAR. But this may help narrow down the search.

If the link stops working, there are other similar services that can be found using you favourite search engine.

geistLich
  • 183
  • 1
  • 7
cowls
  • 24,013
  • 8
  • 48
  • 78
2

In eclipse, open some class and just import TimedWindowEvent class and press function key F3 or press Ctrl+mouse click eclipse will take it to the jar the class comes from.

Sajan Chandran
  • 11,287
  • 3
  • 29
  • 38
1

If you are using Eclipse, use the "Open Type" dialog (ctrl-shift-T) and search for the class.

When it is found, at the bottom of the dialog you can see which jar file it is in.

This only works if the jar file is in your classpath.

moeTi
  • 3,884
  • 24
  • 37
  • +1. Even thou a problem with this is when the Jar is not in eclipse runtime (e.g. is not used in any project's runtime) – BigMike Dec 19 '12 at 11:20
0

In Eclipse:

  1. Press Ctrl+Shift+T
  2. This will open a dialog box. Enter the class name.
  3. Then it will search all the matching class files
  4. On selecting class file, at the bottom of the dialog box, it shows the jar file in the class path which contains this class.
ROMANIA_engineer
  • 54,432
  • 29
  • 203
  • 199
Santosh
  • 17,667
  • 4
  • 54
  • 79