Didn’t know where else to post this, figured Ken might see it this way since gluegen is related to jogl and joal.
I’m working on some fancy OSGi code which requires native libraries for some heavy lifting. Anyone who has tried complicated JNI will see my problem right away, I need to load multiple native libraries and I can’t alter the PATH or LD_LIBRARY_PATH. -Djava.library.path won’t help either. I know the dependency order, that’s not a problem.
I’ve tried explicitly loading the libraries via System.load/loadLibrary, no dice. I know for a fact the libraries work when I see LD_LIBRARY_PATH, so my problem is convincing the OS to resolve the links between libraries.
I read over this (old) thread: http://forum.java.sun.com/thread.jspa?threadID=768162&messageID=4386566
I’ve dug around in gluegen, jogl, and joal and tried this:
// For example, let's say I've got two libraries libA.so and libB.so
// B depends on A.
// NativeLibrary is from gluegen
// This call works, at least it SAYS that A is loaded. I get a path and resources
// Don't worry about this classloader
NativeLibrary dep = NativeLibrary.open("A", null);
NativeLibrary main = NativeLibrary.open("B", null); // returns null
// If I set LD_LIBRARY_PATH for this example, both libraries will load
// but the function addresses won't resolve
I’d be really nice to figure out how to load dependent native libraries. I guess I could statically compile, but sometimes that can be a royal pain.