Applied a patch from Alec Wysoker for finding snappy DLL via java.library.path
This commit is contained in:
parent
6771e58b46
commit
85d9cc9084
|
@ -187,20 +187,20 @@ public class LoadSnappy
|
|||
// Load the os-dependent library from a jar file
|
||||
snappyNativeLibraryPath = "/org/xerial/snappy/native/" + OSInfo.getNativeLibFolderPathForCurrentOS();
|
||||
|
||||
if (LoadSnappy.class.getResource(snappyNativeLibraryPath + "/" + snappyNativeLibraryName) == null) {
|
||||
// use nested VM version
|
||||
return;
|
||||
}
|
||||
|
||||
if (LoadSnappy.class.getResource(snappyNativeLibraryPath + "/" + snappyNativeLibraryName) != null) {
|
||||
// Temporary library folder. Use the value of java.io.tmpdir
|
||||
String tempFolder = new File(System.getProperty("java.io.tmpdir")).getAbsolutePath();
|
||||
// Try extracting the library from jar
|
||||
if (extractAndLoadLibraryFile(snappyNativeLibraryPath, snappyNativeLibraryName, tempFolder)) {
|
||||
isLoaded = true;
|
||||
return;
|
||||
}
|
||||
|
||||
}
|
||||
try {
|
||||
System.loadLibrary("snappy");
|
||||
isLoaded = true;
|
||||
} catch (UnsatisfiedLinkError e) {
|
||||
isLoaded = false;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue