Question

I'm developing an Eclipse plugin, and want to use some pre-compiled classes which I've put to lib/ folder in my project (so the directory structure looks like {proj_root}/lib/com/example/Required.class). Then I've added lib/ folder as class folder to project's build path. At build time all is working fine, I can import and use that classes in my code. And now the problem is, when I'm running my plugin in separate Eclipse instance I get ClassNotFoundException by my plugin refering to class from precompiled classes folder.

I tried specifying my class folder in "Order and export" tab in Build path settings. Also I tried setting checkbox in plugin's build.properties GUI editor in front of lib/ folder to be included in binary build. In that case if I export my plugin to JAR I can see lib/ folder inside it, with my classfiles, but at runtime my plugin still cannot find any of classes from lib/.

Can you please give me an advice on how I should tell Eclipse where to find that classes at runtime?
PS.:

  1. I did research on stackoverflow on this problem, but all suggestions are the same: just add class folder in project's Build path.
  2. At this point in plugin's build.properties Text editor, eclipse shows warning The class folder 'lib/' is not associated to any output library entry. and suggests to make this modification of code: output.. = bin/,lib/. I have tried that solution but it is seems to change nothing with the problem.
Was it helpful?

Solution

It sounds very much like you have added the lib folder to the "Java Build Path" properties page of the plug-in project.

But... for plug-in projects, this does not work as these are OSGi bundles - you must include the lib folder in the PDE Editor on the "Runtime" page:

Classpath description for OSGi

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top