Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

External jars in eclipse plug-in

I'm creating an eclipse plug-in and I'm having trouble with external jars. In my plug-in I start an application which requires some external jars. What do I have to do to export them automatically with the rest of the plug-in?

Thanks in advance :)

like image 909
ruhungry Avatar asked Dec 05 '11 15:12

ruhungry


1 Answers

This is what has worked for me. If they are truly external, and this is a project for your company that is not going to be in the "wild" and you control the environment, and you have them out on the file system say at /opt/java/lib/somedir/some.jar you can tell the bundle where to find them by adding them to the Bundle-ClassPath entry in the MANIFEST.MF under META-INF. The syntax is: Bundle-ClassPath: ., external:/opt/java/lib/somedir/some.jar, external:/opt/java/lib/someotherdir/someother.jar

Also it would be prudent to use these in your build path so that you are working with the same jars in both build and runtime environments.

I have done this where the Jars are multi-purpose (such as apache-commons) on our file systems and again we control the environment.

Reference the following: http://www.eclipsezone.com/eclipse/forums/t51870.html

like image 61
Jim Avatar answered Oct 18 '22 10:10

Jim