updated bundle activitor to handle dynlib/jnilib issues on macos jdk7+

This commit is contained in:
Alex Bowen 2014-07-03 14:18:01 -04:00
parent da6263ff03
commit 3e674a0f3c
1 changed files with 8 additions and 2 deletions

View File

@ -48,8 +48,14 @@ public class SnappyBundleActivator implements BundleActivator
* that the library is available on the path based on this {@link Bundle}'s {@link Manifest}.
*/
public void start(BundleContext context) throws Exception
{
System.loadLibrary(System.mapLibraryName(LIBRARY_NAME));
{
String library = System.mapLibraryName(LIBRARY_NAME);
if (library.toLowerCase().endsWith(".dylib"))
{
// some MacOS JDK7+ vendors map to dylib instead of jnilib
library = library.replace(".dylib", ".jnilib");
}
System.loadLibrary(library);
SnappyLoader.setApi(new SnappyNative());
}