Return of the "java.lang.UnsatisfiedLinkError: Can't load library: /System/Library/Frameworks/gluegen-rt.Framework/gluegen-rt" exception...
Posted by Alexis Drogoul on Jun 01, 2015; 12:01am
URL: https://forum.jogamp.org/Return-of-the-java-lang-UnsatisfiedLinkError-Can-t-load-library-System-Library-Frameworks-gluegen-rt-tp4034549.html
Hi,
I have a project that uses JOGL2, and which follows all the guidelines for correctly loading the native libraries (jars inside the plugin, use of FileLocator to tell the JarUtil.Resolver where to look, removal of old j3D libraries from the system paths, and so on). I ran it happily on a combination of MacOS X Yosemite, Eclipse Juno 3.8.2, and JDK 6 to 8.
Recently, we moved the project to Eclipse Luna (4.3.2) and the good old exception "java.lang.UnsatisfiedLinkError: Can't load library: /System/Library/Frameworks/gluegen-rt.Framework/gluegen-rt" appeared, first on one computer, and then on others. It seems a little bit random, and sometimes a restart of the computer removes it).
Luna is the only difference found between the two installations. However, this change in Eclipse version could also signify a change (in some configurations) of the default JDK used to run Eclipse (and, then, to run RCP projects launched from Eclipse).
Could this be the culprit ? Juno ran by default on JDK 6 (the one by Apple), while Luna seems to launch on the latest installed (JDK 7 or 8, the ones by Oracle). And, in that case, I remember having read somewhere that the format (or at least the extension) of dynamic libraries used by the JDK on MacOS X had changed (from "jnilib" to "dylib", is that it ?). Should I rename the libraries inside the macos-x-universal jars to accommodate for this ? And in that case, what would happen for people still running on JDK 6 (some of our users won't/cant upgrade) once we release the application ?
Thanks in advance for some advices. In the meanwhile, I will experiment some combinations of library names/OS version/JDK version — but if you already have faced (and solved) the problem, that would be a great help !
Cheers
Alexis