Reputation: 19582
If I have a project with hundrends of jar
files, and e.g. I have an import
of a package that can not be found, how would I find which jar
should I include?
I.e. how do I know that package a.b.c
is defined in X.jar
under /filesystem/jars
where under this path there are hundrends of jars
?
Is there e.g. a tool to search inside jars? grep-like for jars?
Upvotes: 0
Views: 6943
Reputation: 68972
You could also try to add the java option -verbose:class
to your startup options, this will produce dumps like:
[Loaded java.security.BasicPermissionCollection from shared objects file]
[Loaded sun.misc.JavaSecurityProtectionDomainAccess from C:\Program Files (x86)\Java\jdk1.6.0_32\jre\lib\rt.jar]
[Loaded java.security.ProtectionDomain$2 from C:\Program Files (x86)\Java\jdk1.6.0_32\jre\lib\rt.jar]
[Loaded java.security.ProtectionDomain$Key from C:\Program Files (x86)\Java\jdk1.6.0_32\jre\lib\rt.jar]
[Loaded java.security.Principal from shared objects file]
See also what-is-shared-objects-fil
I use eclipse with maven. In this environment I can simply open the class and choose View in Package Explorer
from the context menu. After that the Package Explorer shows the expanded strcuture of the jar in the Maven Dependcies.
Upvotes: 1
Reputation: 1956
Just google with the class name say "org.apache.struts.action.ActionMessages + jar".
You will get the jars which has the respective class.
you can also search in http://www.jarfinder.com.
Upvotes: 3