Search code examples
javaeclipseeclipse-plugin

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?


Solution

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

    Runtime tab of Plug-in Manifest Editor

    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.