Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Manipulate the java class path of an Eclipse plugin?

I am working on a plugin that consist of a homemade view to Eclipse. When I run the plugin and display the classpath using System.getProperty("java.class.path") I get this as output : D:\Programs\eclipse\plugins\org.eclipse.equinox.launcher_1.3.100.v20150511-1540.jar

I would like to add some .jar files for the proper functioning of my view, but I can't figure out how... I guess you can do it by adding some specifications to the MANIFEST.MF of the plugin but I don't know how to do it propely. any ideas ?

like image 477
Logan Wlv Avatar asked Sep 10 '26 03:09

Logan Wlv


1 Answers

Each Eclipse plugin has its own classpath. To use additional jars in the plugin you need to include them in the plugin.

Add your jars to the plugin directory. Usually they are put in a 'lib' directory.

Open the plugin MANIFEST.MF editor and on the 'Runtime' tab in the 'Classpath' section click the 'Add...' button and add your jars to the class path.

On the 'Build' tab of the editor make sure the 'lib' folder is include in the Binary Build section.

Your MANIFEST.MF should end up with a `Bundle-Classpath' entry that looks something like:

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

(here I have 3 jars in a lib folder).

The build.properties file should be something like:

bin.includes = META-INF/,\
               .,\
               plugin.xml,\
               lib/,\
               lib/jogg-0.0.7.jar,\
               lib/jorbis-0.0.15.jar,\
               lib/vorbisspi1.0.2.jar
like image 50
greg-449 Avatar answered Sep 11 '26 18:09

greg-449



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!