Never add jars directly to the build path when creating plugins.
You must include all jars in your plugin (or as other plugins) and set the Bundle-Classpath
and include the jars in the build.properties
. If you are referencing other plugins just add them the your plugin's dependencies.
You can add them to the MANIFEST.MF using the MANIFEST.MF/plugin.xml/build.properties editor.
On the editor 'Runtime' tab add the jars to the 'Classpath' entries (there should also be a '.' entry for you main plugin code).
On the 'Build' tab of the editor check all jars you want to include in the plugin. You should put the jars somewhere in your plugin (a 'lib' directory for example).
For example, in this build.properties:
source.. = src/
output.. = bin/
bin.includes = META-INF/,\
.,\
plugin.properties,\
plugin.xml,\
lib/jogg-0.0.7.jar,\
lib/jorbis-0.0.15.jar,\
lib/vorbisspi1.0.2.jar,\
icons/
I have three jars in a 'lib' directory.
The MANIFEST.MF for this looks like:
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: %plugin.name
Bundle-SymbolicName: greg.music.ogg;singleton:=true
Bundle-Version: 2.0.0.qualifier
Bundle-Vendor: %plugin.provider
Bundle-Localization: plugin
Require-Bundle: greg.music.core;bundle-version="1.0.0",
greg.music.resources;bundle-version="1.0.0",
org.eclipse.core.runtime,
javazoom.jlgui.basicplayer,
org.eclipse.e4.core.services;bundle-version="2.0.100"
Bundle-ClassPath: .,
lib/jogg-0.0.7.jar,
lib/jorbis-0.0.15.jar,
lib/vorbisspi1.0.2.jar
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
Import-Package: javax.annotation;version="1.0.0",
javax.inject;version="1.0.0",
org.eclipse.e4.core.di.annotations
Runtime tab in editor:
Build tab:
bin.includes
part ofbuild.properties
. – Gábor Bakos