简体   繁体   中英

Eclipse plugin project and user library

I tried to add my own User Library to my eclipse plugin project. But when I run the project, I get the java.lang.ClassNotFoundException . It only works, when I add single jars like mentioned in the accepted answer to this question: Adding jars to a Eclipse PlugIn

How do I use custom User Libraries correctly in eclipse plugin projects?

You don't. Your plug-in executes in the plug-in runtime, which means all of its dependencies have to be stated in its manifest or delivered as part of that plug-in. You'll have to place whatever jars make up the user library into the project itself and add them to the runtime section of your manifest.

插件清单编辑器的运行时选项卡

Don't edit the Java Build Path manually. PDE will change it so that it keeps up with the manifest's contents, but that only goes one-way.

I generally do it by

1. Open your plugin.xml
2. Go to Runtime tab and add your JAR in the classpath section
3. Also you have to add the plugin dependencies

http://help.eclipse.org/indigo/index.jsp?topic=/org.eclipse.pde.doc.user/guide/tools/editors/manifest_editor/dependencies.htm

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM