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.
Java

Avatar of undefined
Last Comment
CEHJ

8/22/2022 - Mon
brunoguimaraes

I would do a google search.
brunoguimaraes

Using google I found out this class belongs to a jar called jaxrpc-api.jar
CEHJ

Try using this utility. Example:

java -jar jarsearch.jar %JAVA_HOME% ServiceFactory
All of life is about relationships, and EE has made a viirtual community a real community. It lifts everyone's boat
William Peck
ASKER CERTIFIED SOLUTION
CEHJ

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
ICPooreman

ASKER
java -jar jarsearch.jar %JAVA_HOME% ServiceFactory

doesn't print anything out... would it be expected that it could find ServiceFactory?
CEHJ

>>
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
CEHJ

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
ICPooreman

ASKER
awesome that's really cool, thanks alot.
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
CEHJ

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

ASKER
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

CEHJ

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

javax/xml/rpc/ServiceFactory

as a parameter
Your help has saved me hundreds of hours of internet surfing.
fblack61