O'Reilly logo

Mastering Eclipse Plug-in Development by Dr. Alex Blewitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Native libraries in OSGi bundles

To support loading native code in OSGi bundles, the framework defines a specific header, Bundle-NativeCode, which defines the libraries that are available to the bundle via the System.loadLibrary call.

The Bundle-NativeCode header defines one or more native libraries and a clause which states what operating systems and processor architectures are valid for each library. Calls to System.loadLibrary will then look for libraries mentioned in this list and use only those found for the appropriate architecture. In effect, the Bundle-NativeCode header replaces the java.library.path property.

In the prior example, the maths library was used for performing calculations. In an OSGi bundle, this could be packaged with the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required