3

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.
4

1 回答 1

7

听起来很像您已将lib文件夹添加到插件项目的“Java Build Path”属性页面。

但是...对于插件项目,这不起作用,因为这些是 OSGi 捆绑包 - 您必须lib在“运行时”页面的 PDE 编辑器中包含该文件夹:

OSGi 的类路径描述

于 2013-08-20T09:26:22.443 回答