Eclipse RCP with project dependency

末鹿安然 提交于 2020-01-10 20:05:31

问题


I have developed an RCP plug-in (not standalone), and a Java Project with library code that the plug-in needs to call.

I have configured the Java Project in the same workspace. The plug-in has a project dependency on the Java Project.

The code compiles (the plug-in does some stuff with the Java Project / library code).

When I run the plug-in, I get a ClassNotFoundException:

java.lang.ClassNotFoundException: com.mycode.ArgSet
    at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:494)

Anyone know how to configure the plug-in properly?


回答1:


Convert your library project to a plug-in project (right-click -> Configure -> Convert to Plug-in Project) and add it to the dependencies of your plug-in project (manifest editor, Dependencies tab).




回答2:


You can also generate a JAR of your libray Project and add this jar to your plugin-project. That's the way we do it (but thats not that automatically, you have to export manualy every time you change the library-project.

The other bad with this jar-export is: when using another libraries (i.E. AXIS2 for Webservice,...) this Libraries must have also been added to the plugin project.



来源:https://stackoverflow.com/questions/2185339/eclipse-rcp-with-project-dependency

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!