Including a jar in Eclipse plugin - NoClassDefFound error :-(
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Stephan_Korsholm
Posted On:   Wednesday, June 3, 2009 07:16 AM

I cannot seem to include a jar in my eclipse plugin. I have created the very simple template plugin just containing a simple table view. Then I have created a jar with just one package and one class (dummy.Dummy). In the runtime tab of the plugin editor I have added my jar to the plugin classpath. And the jar shows up in the MANIFEST.MF file under 'Bundle-ClassPath'. The plugin builds without errors and I can run the plugin from inside Eclipse by launching a new Eclipse instance. The plugin will instantiate the class from the jar when i double click a leaf in the tree view, and this works well when running from inside Eclipse. But when I deploy the plugin properly it doesn't work: I get a 'NoClassDefFound' error when I instantiate the class from the ja   More>>

I cannot seem to include a jar in my eclipse plugin. I have created the very simple template plugin just containing a simple table view. Then I have created a jar with just one package and one class (dummy.Dummy). In the runtime tab of the plugin editor I have added my jar to the plugin classpath. And the jar shows up in the MANIFEST.MF file under 'Bundle-ClassPath'.

The plugin builds without errors and I can run the plugin from inside Eclipse by launching a new Eclipse instance. The plugin will instantiate the class from the jar when i double click a leaf in the tree view, and this works well when running from inside Eclipse. But when I deploy the plugin properly it doesn't work: I get a 'NoClassDefFound' error when I instantiate the class from the jar.

I believe I have made the simplest possible setup.

I have tried and retried this many times without success. Hope somebody can give me some hints as to what might be the cause or what I can check.

Kind regards,

   <<Less

Re: Including a jar in Eclipse plugin - NoClassDefFound error :-(

Posted By:   Stephan_Korsholm  
Posted On:   Wednesday, June 3, 2009 08:15 AM

I have found the answer, though I don't understand it: If I start eclipse with

eclipse -clean

it works???? Subsequent invocations of eclipse does not require the -clean option.

After searching the web I find that the -clean option should be used if upgrading an Eclipse environment, but the funny thing is that I'm working on a freshly installed fedora 10 linux installation and I have always only had one instance of eclipse (version 3.4.2) installed?

Maybe the fedora installation has some data somewhere that is read by eclipse and makes it not load my jars unless I use the -clean option first.

That was three days of work down the drain :-( BUT I love eclipse and plugins and it has saved me 300 days of work, so I'm still happy :-)
About | Sitemap | Contact