0

I have developed a plugin for Eclipse which has to access native libraries.

Is it mandatory that the .so file resides in /usr/lib for the plugin to access it? Unless it is present there, my plugin cannot access the methods within it. I need my plugin to access the .so within itself so that even when I deploy the plugin, it should work without any configuration changes. I have used System.loadLibrary() to load the .so but even when I loaded the library using its full path in System.load(), it didn't work unless I copy the .so file to /usr/lib.

How can I make my plugin access it from its own source folder?

JoshDM
  • 4,939
  • 7
  • 43
  • 72

1 Answers1

0

You need to add the Bundle-NativeCode directive to your MANIFEST.MF. Here are a couple of links on how to formulate it:

Secrets of Bundle-NativeCode

Bundle-NativeCode in the OSGi manifest

Note that the path you give in the directive is relative to your plugin directory structure. E.g., '/mylibrary.so' means the file is in root directory of your plugin.

MrMas
  • 1,143
  • 2
  • 14
  • 28