We help IT Professionals succeed at work.

figuring out what jar a package belongs to

ICPooreman
ICPooreman asked
on
305 Views
Last Modified: 2013-11-23
So I've got a bunch of packages in eclipse that can't be found.

For example in eclipse the following package exists with an error because the associated jar isn't imported into the project.  What's the best way to figure out what jar the following package is associated with.
 javax.xml.rpc.ServiceFactory

I'm not neccessarily looking for the answer but the way to go about finding the answer as this circumstance occurs quite often.
Comment
Watch Question

I would do a google search.
Using google I found out this class belongs to a jar called jaxrpc-api.jar
CERTIFIED EXPERT
Top Expert 2016

Commented:
Try using this utility. Example:

java -jar jarsearch.jar %JAVA_HOME% ServiceFactory
CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
java -jar jarsearch.jar %JAVA_HOME% ServiceFactory

doesn't print anything out... would it be expected that it could find ServiceFactory?
CERTIFIED EXPERT
Top Expert 2016

Commented:
>>
doesn't print anything out...

Actually service factory isn't in the JDK, but it should print something else out. Are you saying it prints nothing?
CERTIFIED EXPERT
Top Expert 2016
Commented:
This one is on us!
(Get your first solution completely free - no credit card required)
UNLOCK SOLUTION

Author

Commented:
awesome that's really cool, thanks alot.
CERTIFIED EXPERT
Top Expert 2016

Commented:
Can you provide the output you got just for the sake of completeness?

Author

Commented:
Sure..
C:\>java -jar jarsearch.jar C:\eclipse ServiceFactory
javax/xml/rpc/ServiceFactory.class IN C:\eclipse\plugins\javax.xml.rpc_1.1.0.v200706111329\lib\jaxrpc.jar
org/apache/axis/client/ServiceFactory.class IN C:\eclipse\plugins\org.apache.axis_1.4.0.v200706191647\lib\axis.jar
org/apache/axis/client/ServiceFactory.class IN C:\eclipse\plugins\org.eclipse.birt.report.viewer_2.1.2.v20070205-1728\birt\WEB-INF\lib\axis.jar
javax/xml/rpc/ServiceFactory.class IN C:\eclipse\plugins\org.eclipse.birt.report.viewer_2.1.2.v20070205-1728\birt\WEB-INF\lib\jaxrpc.jar
org/eclipse/birt/report/service/BirtReportServiceFactory.class IN C:\eclipse\plugins\org.eclipse.birt.report.viewer_2.1.2.v20070205-1728\birt\WEB-INF\lib\viewservlets.jar
org/eclipse/datatools/connectivity/derby/ui/explorer/providers/virtual/IVirtualNodeServiceFactory.class IN C:\eclipse\plugins\org.eclipse.datatools.connectivity.derby.ui_1.0.0.200706071.jar
org/eclipse/datatools/connectivity/sqm/core/internal/ui/explorer/providers/content/virtual/VirtualNodeServiceFactory.class IN C:\eclipse\plugins\org.eclipse.datatools.connectivity.sqm.core.ui_1.0.0.200706151.jar
org/eclipse/datatools/connectivity/sqm/core/internal/ui/explorer/services/IVirtualNodeServiceFactory.class IN C:\eclipse\plugins\org.eclipse.datatools.connectivity.sqm.core.ui_1.0.0.200706151.jar
org/eclipse/datatools/enablement/sybase/asa/providers/IVirtualNodeServiceFactory.class IN C:\eclipse\plugins\org.eclipse.datatools.enablement.sybase.asa_1.0.0.200706071.jar
org/eclipse/equinox/http/registry/internal/HttpServiceTracker$HttpContextExtensionServiceFactory.class IN C:\eclipse\plugins\org.eclipse.equinox.http.registry_1.0.0.v20070608.jar
org/eclipse/equinox/http/servlet/internal/HttpServiceFactory.class IN C:\eclipse\plugins\org.eclipse.equinox.http.servlet_1.0.0.v20070606.jar
org/eclipse/equinox/log/LogReaderServiceFactory.class IN C:\eclipse\plugins\org.eclipse.equinox.log_1.0.0.v20060601a.jar
org/eclipse/equinox/log/LogServiceFactory.class IN C:\eclipse\plugins\org.eclipse.equinox.log_1.0.0.v20060601a.jar
org/eclipse/equinox/log/LogReaderServiceFactory.class IN C:\eclipse\plugins\org.eclipse.equinox.log_1.0.1.R32x_v20060717.jar
org/eclipse/equinox/log/LogServiceFactory.class IN C:\eclipse\plugins\org.eclipse.equinox.log_1.0.1.R32x_v20060717.jar
org/eclipse/jdt/apt/core/internal/ClassServiceFactory.class IN C:\eclipse\plugins\org.eclipse.jdt.apt.core_3.3.0.v20070607-1200.jar
org/eclipse/jdt/apt/core/internal/IServiceFactory.class IN C:\eclipse\plugins\org.eclipse.jdt.apt.core_3.3.0.v20070607-1200.jar
org/osgi/service/cm/ManagedServiceFactory.class IN C:\eclipse\plugins\org.eclipse.osgi.services_3.1.100.v20060601.jar
org/osgi/service/cm/ManagedServiceFactory.class IN C:\eclipse\plugins\org.eclipse.osgi.services_3.1.200.v20070605.jar
org/osgi/framework/ServiceFactory.class IN C:\eclipse\plugins\org.eclipse.osgi_3.2.0.v20060601.jar
org/osgi/framework/ServiceFactory.class IN C:\eclipse\plugins\org.eclipse.osgi_3.2.2.R32x_v20070118.jar
org/osgi/framework/ServiceFactory.class IN C:\eclipse\plugins\org.eclipse.osgi_3.3.0.v20070530.jar
org/eclipse/swt/browser/PromptServiceFactory$1.class IN C:\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar
org/eclipse/swt/browser/PromptServiceFactory$2.class IN C:\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar
org/eclipse/swt/browser/PromptServiceFactory.class IN C:\eclipse\plugins\org.eclipse.swt.win32.win32.x86_3.3.0.v3346.jar
org/eclipse/ui/navigator/NavigatorContentServiceFactory.class IN C:\eclipse\plugins\org.eclipse.ui.navigator_3.3.0.I20070605-0010.jar
org/apache/xmlbeans/impl/jam/JamServiceFactory.class IN C:\eclipse\plugins\org.maven.ide.components.maven_model_edit_1.0.0.20080331-1600\jars\xmlbeans-2.3.0.jar
org/apache/xmlbeans/impl/jam/provider/JamServiceFactoryImpl.class IN C:\eclipse\plugins\org.maven.ide.components.maven_model_edit_1.0.0.20080331-1600\jars\xmlbeans-2.3.0.jar
org/osgi/service/cm/ManagedServiceFactory.class IN C:\eclipse\plugins\org.ops4j.pax.eclipse.cursor.oflc_0.3.0.jar
org/osgi/framework/ServiceFactory.class IN C:\eclipse\plugins\org.ops4j.pax.eclipse.cursor.oflc_0.3.0.jar
org/apache/felix/framework/ServiceRegistrationImpl$ServiceFactoryPrivileged.class IN C:\eclipse\plugins\org.ops4j.pax.eclipse.cursor.oflc_0.3.0.jar

Open in new window

CERTIFIED EXPERT
Top Expert 2016

Commented:
Thanks - that's good. Of course, you could have reduced the output by passing

javax/xml/rpc/ServiceFactory

as a parameter
Unlock the solution to this question.
Join our community and discover your potential

Experts Exchange is the only place where you can interact directly with leading experts in the technology field. Become a member today and access the collective knowledge of thousands of technology experts.

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.