Problems with OSGi and automatic native loading with JARs

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Problems with OSGi and automatic native loading with JARs

justin
I have an OSGi application that uses JOGL. Previously, I used RC3 and extracted jogl.all.jar and gluegen-rt.jar into a bundle, then added all the native libraries for each platform to that bundle. This allowed me to have a single JAR / OSGi bundle that worked with all platforms.

As of RC4 (I believe), the natives are automatically loaded from the native JARs. I am unsure how I can package an OSGi bundle that handles this mechanism, and would appreciate any tips.
Reply | Threaded
Open this post in threaded view
|

Re: Problems with OSGi and automatic native loading with JARs

gouessej
Administrator
Hi

You should package the JARs containing the native libraries in the same fragment than jogl.all.jar
Julien Gouesse | Personal blog | Website
Reply | Threaded
Open this post in threaded view
|

Re: Problems with OSGi and automatic native loading with JARs

Wade Walker
Administrator
In reply to this post by justin
Expanding a bit on what Julien said, my OSGi projects currently have a main JOGL bundle (containing the code JARs), plus one fragment per platform containing the dll/so/jnilib files. I assume (I haven't tried yet) that with the new "all platforms" natives JAR, we should be able to just put that with the code JARs and eliminate the fragments entirely. If you're using the per-platform natives JARs, you'd have to keep the per-platform fragments, they'd just have natives JARs in them instead of dll/so/jnilib files.

Reply | Threaded
Open this post in threaded view
|

Re: Problems with OSGi and automatic native loading with JARs

JStoecker
Interesting, thank you both. I have not used fragments before, but I will have to try this out.

Previously, I had a single JAR that contained both the code and the natives as described here: http://josh-in-antarctica.blogspot.com/2008/05/visualizer-part-2-osgi-native-libraries.html