Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Equinox » How to export other (separate) projects with another plug-in project?
icon4.gif  How to export other (separate) projects with another plug-in project? [message #538268] Mon, 07 June 2010 07:54 Go to next message
Arlindo is currently offline ArlindoFriend
Messages: 33
Registered: August 2009
Member
I'm developing a plug-in, in a Eclipse Plug-in Project, that uses classes from a separate Eclipse Java Project (I added the Java Project to the Build Path of the Plug-in Project).

However, when I run the plug-in as an Eclipse Application and launch the plug-in in the new Eclipse instance, I get a java.lang.NoClassDefFoundError for the classes of the separate Java Project...

How can I solve this? How can I make the classes in the separate project be exported with the plug-in?

Regards.
Re: How to export other (separate) projects with another plug-in project? [message #538368 is a reply to message #538268] Mon, 07 June 2010 13:35 Go to previous messageGo to next message
Thomas Watson is currently offline Thomas WatsonFriend
Messages: 503
Registered: July 2009
Senior Member
In general PDE expects projects to be self-contained. All other things they need to compile and run should be declared with OSGi meta-data to specify the constraints on external packages.

So the other project that contains the class you need should also be a Plug-in Project and should export the packages you need with the OSGi Export-Package manifest header. Then your original project should use Import-Package (or Require-Bundle) to pull in the other projects packages onto the class path. This should work for both building and running the bundle from your workspace.

HTH

Tom.
Re: How to export other (separate) projects with another plug-in project? [message #538398 is a reply to message #538368] Mon, 07 June 2010 14:36 Go to previous messageGo to next message
Roland Tepp is currently offline Roland TeppFriend
Messages: 336
Registered: July 2009
Senior Member
Hi,

We've run into the same problem - we have a set of libraries that is
used on the server side (and built with ANT) and some of our plug-ins
need those libraries.

Invoking the full blasted PDE build on those libraries is undesireable
(the cost of setting up the PDE build alone is more trouble than it is
worth, maintaining it is even more of a headache)

For now we've settled on just copying those libraries into a "master
library" bundle/plug-in and building our RCP app this way, but it also
has its ugly long tail of problems and I would not recommend this to
anyone else.

If someone at Eclipse would suggest some better alternatives, I'd be
glad to investigate. For now we are considering including either Bnd
tool or Bundlor into our build/development toolchain.

Incubating b3 broject is also a promising candidate, but I'd wait for it
to mature a little...

7.06.2010 16:35, Thomas Watson kirjutas:
> In general PDE expects projects to be self-contained. All other things
> they need to compile and run should be declared with OSGi meta-data to
> specify the constraints on external packages.
>
> So the other project that contains the class you need should also be a
> Plug-in Project and should export the packages you need with the OSGi
> Export-Package manifest header. Then your original project should use
> Import-Package (or Require-Bundle) to pull in the other projects
> packages onto the class path. This should work for both building and
> running the bundle from your workspace.
>
> HTH
>
> Tom.


--
Roland Tepp
Re: How to export other (separate) projects with another plug-in project? [message #538404 is a reply to message #538398] Mon, 07 June 2010 14:54 Go to previous message
Paul Webster is currently offline Paul WebsterFriend
Messages: 6859
Registered: July 2009
Location: Ottawa
Senior Member

When you build the java jars with ant, you could just provide an
appropriate manifest (works great for library jars) that exports
packages. You don't need to run it through PDE build to get a valid
bundle (which is really just a jar + an OSGi MANIFEST.MF). Or do think
you have complications in your process that would prevent it?

PW


--
Paul Webster
http://wiki.eclipse.org/Platform_Command_Framework
http://wiki.eclipse.org/Command_Core_Expressions
http://wiki.eclipse.org/Menu_Contributions
http://wiki.eclipse.org/Menus_Extension_Mapping
http://help.eclipse.org/galileo/index.jsp?topic=/org.eclipse .platform.doc.isv/guide/workbench.htm


Previous Topic:How to get Bundle dependencies ?
Next Topic:Framework extension unexpectedly active
Goto Forum:
  


Current Time: Tue Apr 16 13:17:47 GMT 2024

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

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

Back to the top