Skip to main content



      Home
Home » Eclipse Projects » Rich Client Platform (RCP) » Can't see classes from a JAR used in another plugin(Even though all those classes and the JAR itself are exported)
icon5.gif  Can't see classes from a JAR used in another plugin [message #684704] Thu, 16 June 2011 00:50 Go to next message
Eclipse UserFriend
My project consists of two plugins, main and other. Plugin other uses a JAR and I want to be able to reference the classes in that JAR from plugin main. Plugin main already declares plugin other as a dependency and in plugin other I have specified the JAR file in the build properties tab and have marked all the packages in that JAR as exported in the Runtime tab. However, project main still can't see any of the packages in the desired JAR.

How do I get the packages and classes in the JAR in plugin other to be accessible to plugin main? When I export plugin other I can see that the desired JAR is included in the exported JAR so I am baffled.

Thanks,

-sbs
Re: Can't see classes from a JAR used in another plugin [message #684861 is a reply to message #684704] Thu, 16 June 2011 07:12 Go to previous messageGo to next message
Eclipse UserFriend
You can try using PDE Tools>Update Classpath on both plugins and the build clean. If that doesn't work, please post both MANIFEST.MF files.

PW
Re: Can't see classes from a JAR used in another plugin [message #685102 is a reply to message #684861] Thu, 16 June 2011 16:24 Go to previous messageGo to next message
Eclipse UserFriend
That didn't help and I am not really allowed to post any of the source of this project unfortunately.

Anyway, what I am really trying to achieve is to be able to use some JARs in plugin main and I thought the correct way to do that was to create a plugin that exports the classes in the JARs and then add that plugin as a dependency.

Is there a simpler/better way of doing it? Plugin main just can't see those exported classes from plugin other's JARs.

-sbs
Re: Can't see classes from a JAR used in another plugin [message #685549 is a reply to message #685102] Fri, 17 June 2011 14:08 Go to previous message
Eclipse UserFriend
That's the correct way. Create a plugin project. Import the jars (license permitting Smile Make sure they're in the build.properties. Add them to the bundle classpath. Export the packages.

That works fine for me, package "ex" is in the version_0.1.0.jar, and generates a MANIFEST.MF that looks like:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Extjar
Bundle-SymbolicName: z.ex.extjar
Bundle-Version: 0.1.0.qualifier
Bundle-Activator: z.ex.extjar.Activator
Require-Bundle: org.eclipse.core.runtime
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-ActivationPolicy: lazy
Bundle-ClassPath: version_0.1.0.jar,
 .
Export-Package: ex;version="0.1.0"


I only need core.runtime because I'm providing an Activator (but if you don't need one, then you can get rid of that require-bundle as well).

I was able to consume this with a Require-Bundle on z.ex.extjar.


PW
Previous Topic:Outline and Property Sheet
Next Topic:Common Navigator In RCP
Goto Forum:
  


Current Time: Sun Aug 31 14:54:42 EDT 2025

Powered by FUDForum. Page generated in 0.04581 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top