Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Plugin Development Environment (PDE) » Including jar from Plugin(Accessing Class Bundled in jar)
Including jar from Plugin [message #666210] Tue, 19 April 2011 13:41 Go to next message
David  is currently offline David Friend
Messages: 23
Registered: June 2010
Junior Member
Hello everyone,

I have got a problem accessing a class from a jar.

I created a java project and added the package test.helloworld
In this package I created the Class Greeter,
then exported the project as a jar (not runnable).
After that I created a plugin test.plugin and imported the jar into the project. I added it to the build path. The Manifest:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Plugin
Bundle-SymbolicName: test.plugin
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: test.plugin.Activator
Require-Bundle: org.eclipse.core.runtime
Bundle-ActivationPolicy: lazy
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Export-Package: test.helloworld
Bundle-ClassPath: moin.jar,

To use this with other plugins I deployed the plugin and added it to my target platform.
Now I can add the plugin as dependency to the other plugin, or i can import the exported package, but when I try to import the Greeter class eclipse tells me that it cannot resolve the package.
What am I doing wrong here?

Re: Including jar from Plugin [message #666380 is a reply to message #666210] Wed, 20 April 2011 08:47 Go to previous message
David  is currently offline David Friend
Messages: 23
Registered: June 2010
Junior Member
Ok, looks like i found my mistake.

It is not enough to add the plugin with the packed jar to the target definition. It also has to be in the workspace so that eclipse can compile the depending plugins.
In the deployed version it is enough to have the dependency to the jar plugin in the feature, the plugin itself needs not to be included.
Previous Topic:Product export-wizard problem
Next Topic:How to set default compiler compliance level inside plugin
Goto Forum:

Current Time: Sun Jun 20 12:27:03 GMT 2021

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

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

Back to the top