3

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?

divegeek
  • 4,795
  • 2
  • 23
  • 28
  • Wouldn't you have to re-compile the library binary **and** recompile the JNI link between their java native methods an JNI C/C++? – Paul Webster Jun 14 '11 at 16:45

1 Answers1

1

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!

Markus
  • 809
  • 5
  • 10