Login  Register

Re: appbundler jogl jnilib dylib one-jar confusion

Posted by Wade Walker on Nov 24, 2012; 8:05pm
URL: https://forum.jogamp.org/appbundler-jogl-jnilib-dylib-one-jar-confusion-tp4027169p4027180.html

A note on the .dylib vs. .jnilib problem -- I ran into this problem earlier this year with JDK 7 on Mac OS X. The root of the problem is that Oracle changed System.mapLibraryName() in JDK 7 to look for libraries using the .dylib extension instead of the .jnilib extension (see http://mail.openjdk.java.net/pipermail/core-libs-dev/2012-April/009725.html and https://bugs.eclipse.org/bugs/show_bug.cgi?format=multiple&id=276564 for details).

This means that in Eclipse plugins (which find native libraries using class loader hooks that eventually call System.mapLibraryName()), it will look for <library name>.dylib. But in JOGL's native library loader, we explicitly load the library using System.loadLibrary( <library name>.jnilib ), so .jnilib still works in that case even with JDK 7.

My tutorial at http://wadeawalker.wordpress.com/2010/10/09/tutorial-a-cross-platform-workbench-program-using-java-opengl-and-eclipse/ makes note of this, since it shows how to include the native libraries in an Eclipse plugin.