diff --git a/src/main/java/org/xerial/snappy/SnappyBundleActivator.java b/src/main/java/org/xerial/snappy/SnappyBundleActivator.java index 5b0f7a2..6db09af 100755 --- a/src/main/java/org/xerial/snappy/SnappyBundleActivator.java +++ b/src/main/java/org/xerial/snappy/SnappyBundleActivator.java @@ -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()); }