Link to home
Create AccountLog in
Avatar of ICPooreman
ICPooreman

asked on

figuring out what jar a package belongs to

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.
Avatar of brunoguimaraes
brunoguimaraes
Flag of Brazil image

I would do a google search.
Using google I found out this class belongs to a jar called jaxrpc-api.jar
Avatar of CEHJ
Try using this utility. Example:

java -jar jarsearch.jar %JAVA_HOME% ServiceFactory
ASKER CERTIFIED SOLUTION
Avatar of CEHJ
CEHJ
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of ICPooreman
ICPooreman

ASKER

java -jar jarsearch.jar %JAVA_HOME% ServiceFactory

doesn't print anything out... would it be expected that it could find ServiceFactory?
>>
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?
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
awesome that's really cool, thanks alot.
Can you provide the output you got just for the sake of completeness?
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

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

javax/xml/rpc/ServiceFactory

as a parameter