Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where does eclipse look for binary libraries in plugins?

I have an eclipse plugin (developed by a third party, no source code available) that uses a binary library to do some of its work. The library is open source. The distributed plugin includes only the binary for Windows, but I can easily compile it for other platforms. What I can't figure out is where to put the library so that it will be picked up. I'm currently working on OS X, but Linux is an issue as well.

The Windows library is placed in eclipse/plugins/plugin_name/os/win32/x86. I've tried using os/macosx/x86_64 (which corresponds to the the constants in org.eclipse.osgi.service.environments) and a bunch of other variants but nothing works, and I can't find any documentation on how eclipse sets the library path.

Where should I put libraries in a plugin sub-directory so that eclipse will load them for the appropriate platform?

like image 806
divegeek Avatar asked May 13 '26 02:05

divegeek


1 Answers

Binary libraries (*.dll for example) can be bundled within the plugin JAR itself. In this case it is probably in /os/win32/x86/thelib.dll.

If you can edit the META-INF/MANIFEST.MF in the thirdparty plugin (unzip the jar file), check for the header "Bundle-NativeCode". For example:

Bundle-NativeCode: /os/win32/x86;osname=win32;processor=x86

Then you could add paths for OS X this way:

Bundle-NativeCode: /os/win32/x86;osname=win32;processor=x86, /os/osx/x86; osname=macosx;processor=x86

Place OS X libs in the corresponding folder, rezip the jar and you should be done!

like image 106
Markus Avatar answered May 14 '26 15:05

Markus



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!