Fix `Could not initialize class org.xerial.snappy.Snappy` bug for MacOS 19.6.0 (#265)

* Fix `Could not initialize class org.xerial.snappy.Snappy` bug for MacOS

* Remove useless libsnappyjava.jnilib
This commit is contained in:
Benedict Jin 2020-11-09 14:51:50 +08:00 committed by GitHub
parent 9532de9459
commit 1c4a0e31e9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 7 additions and 7 deletions

View File

@ -240,14 +240,14 @@ Mac-x86_CXX := g++ -arch i386
Mac-x86_STRIP := strip -x
Mac-x86_CXXFLAGS := -Ilib/inc_mac -I$(JAVA_HOME)/include -O2 -fPIC -mmacosx-version-min=10.4 -fvisibility=hidden -std=c++11
Mac-x86_LINKFLAGS := -dynamiclib -static-libgcc
Mac-x86_LIBNAME := libsnappyjava.jnilib
Mac-x86_LIBNAME := libsnappyjava.dylib
Mac-x86_SNAPPY_FLAGS :=
Mac-x86_64_CXX := c++ -arch $(OS_ARCH)
Mac-x86_64_STRIP := strip -x
Mac-x86_64_CXXFLAGS := -Ilib/inc_mac -I$(JAVA_HOME)/include -O2 -fPIC -mmacosx-version-min=10.7 -fvisibility=hidden -stdlib=libc++ -std=c++11
Mac-x86_64_LINKFLAGS := -dynamiclib
Mac-x86_64_LIBNAME := libsnappyjava.jnilib
Mac-x86_64_LIBNAME := libsnappyjava.dylib
Mac-x86_64_SNAPPY_FLAGS :=
FreeBSD-x86_64_CXX := $(CROSS_PREFIX)g++

View File

@ -28,8 +28,8 @@ DLL_DIR=src/main/resources/org/xerial/snappy/native
DLL_WIN=$(DLL_DIR)/Windows/x86/snappyjava.dll
DLL_WIN64=$(DLL_DIR)/Windows/amd64/snappyjava.dll
DLL_MAC=$(DLL_DIR)/Mac/x86_64/libsnappyjava.jnilib
DLL_TIGER_MAC=$(DLL_DIR)/Mac/i386/libsnappyjava.jnilib
DLL_MAC=$(DLL_DIR)/Mac/x86_64/libsnappyjava.dylib
DLL_TIGER_MAC=$(DLL_DIR)/Mac/i386/libsnappyjava.dylib
DLL_LINUX=$(DLL_DIR)/Linux/i386/libsnappyjava.so
DLL_AMD64=$(DLL_DIR)/Linux/amd64/libsnappyjava.so

View File

@ -83,8 +83,8 @@ OsgiKeys.additionalHeaders := Map(
"org/xerial/snappy/native/Windows/x86_64/snappyjava.dll;osname=win32;processor=x64",
"org/xerial/snappy/native/Windows/x86_64/snappyjava.dll;osname=win32;processor=amd64",
"org/xerial/snappy/native/Windows/x86/snappyjava.dll;osname=win32;processor=x86",
"org/xerial/snappy/native/Mac/x86/libsnappyjava.jnilib;osname=macosx;processor=x86",
"org/xerial/snappy/native/Mac/x86_64/libsnappyjava.jnilib;osname=macosx;processor=x86-64",
"org/xerial/snappy/native/Mac/x86/libsnappyjava.dylib;osname=macosx;processor=x86",
"org/xerial/snappy/native/Mac/x86_64/libsnappyjava.dylib;osname=macosx;processor=x86-64",
"org/xerial/snappy/native/Linux/x86_64/libsnappyjava.so;osname=linux;processor=x86-64",
"org/xerial/snappy/native/Linux/x86_64/libsnappyjava.so;osname=linux;processor=x64",
"org/xerial/snappy/native/Linux/x86_64/libsnappyjava.so;osname=linux;processor=amd64",

View File

@ -348,7 +348,7 @@ public class SnappyLoader
if (!hasNativeLib) {
if (OSInfo.getOSName().equals("Mac")) {
// Fix for openjdk7 for Mac
String altName = "libsnappyjava.jnilib";
String altName = "libsnappyjava.dylib";
if (hasResource(snappyNativeLibraryPath + "/" + altName)) {
snappyNativeLibraryName = altName;
hasNativeLib = true;