ERROR exporting Eclipse Plug-In

偶尔善良 提交于 2019-12-24 21:17:37

问题


I'm trying to export an Eclipse Plgug-In in Eclipse Oxygen, but I get the following errors (only 2):

The error is in one of my Java Classes, emitter1, when I use the xerces import and then the Base64 Object below, but when I compile the plug-in in the IDE in runs with no errors,

Here's an image of my projects tree:

The import and the object are being used, like I said, in the emitter1 class,

Does anyone know why this is happening and how to solve it?

Maybe I can't use referenced libraries in plug-in projects, or I have to add them in a different way? What I did was: Right-Click on Project -> Properties -> Java Build Path -> Add External Jars, and added xerces jar

Thank you!

Alexandre Jacinto


回答1:


You can't use external jars in a plugin. You can only reference code in other plugins or jars which you include as part of your plugin and add to the Bundle-Classpath in the MANIFEST.MF (and also update the build.properties to include the jars in the build).

An example Bundle-Classpath from one of my plug-ins:

Bundle-ClassPath: .,
 lib/jogg-0.0.7.jar,
 lib/jorbis-0.0.15.jar,
 lib/vorbisspi1.0.2.jar

The . is your normal code and the other entries are jars in a lib directory in the plugin project.

The build.properties would include

bin.includes = ....... other things
               .,\
               lib/jogg-0.0.7.jar,\
               lib/jorbis-0.0.15.jar,\
               lib/vorbisspi1.0.2.jar

If you use the normal plugin.xml/MANIFEST.MF/build.properties editor you define the bundle classpath on the 'Runtime' tab in the 'Classpath' section and the build.properties on the build.properties tab.

Unfortunately Eclipse doesn't check any of this when you test your plugin within Eclipse. The errors only appear in exported plugins and RCPs.



来源:https://stackoverflow.com/questions/51151417/error-exporting-eclipse-plug-in

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