smitha
smitha

Reputation: 11

debuggging eclipse plugin dependancy

I am creating an eclipse plugin that calls some classes from a Java project. I have added this Java project as a required project on my build path. When I create an eclipse plugin jar using an ant script, everything works fine. However when I try to debug the code at run time or open the eclipse as a run time application, the classes from the Java project are not accessible. I get a NoClassDefFoundException.

Is there something I am missing while adding the dependancy?

Upvotes: 1

Views: 77

Answers (1)

Paul Webster
Paul Webster

Reputation: 10654

Eclipse is based on OSGi, and as a rule of thumb, bundles can only see other bundles. Usually for including 3rd party jars in an eclipse plugin, you have 2 choices:

1) Include the jar in your eclipse project. Add it to the build.properties. Edit the MANIFEST.MF and add it to the Classpath section on the Runtime tab.

2) turn the 3rd party jar into a bundle so that your eclipse plugin can require it. You can use File>New>Other...>Plug-in Development>Plug-in from Existing JAR. The simplest form of an OSGi bundle is just the original jar with OSGi headers added to its MANIFEST.MF.

EDIT:

Remember also you have to honour the 3rd party jar license with whichever option you choose.

Upvotes: 1

Related Questions