The following patch modifies the native library loading to use debian native /usr/lib/libsnappy.so file if no specific system property is used.
This fixes the native loading, however, using latest code there are pending issues. Using previous example, it seems that Java library does not match native library: osallou@debiansid:~$ java -cp /home/osallou/snappy-java-1.0.4.1~dfsg/target/snappy-java-1.0.4.1.jar:. SnappyTests Exception in thread "main" java.lang.UnsatisfiedLinkError: org.xerial.snappy.SnappyNative.maxCompressedLength(I)I at org.xerial.snappy.SnappyNative.maxCompressedLength(Native Method) at org.xerial.snappy.Snappy.maxCompressedLength(Snappy.java:316) at org.xerial.snappy.Snappy.rawCompress(Snappy.java:329) at org.xerial.snappy.Snappy.compress(Snappy.java:88) at SnappyTests.main(SnappyTests.java:12) Olivier gpg key id: 4096R/326D8438 (keyring.debian.org) Key fingerprint = 5FB4 6F83 D3B9 5204 6335 D26D 78DC 68DB 326D 8438
--- a/src/main/java/org/xerial/snappy/SnappyLoader.java +++ b/src/main/java/org/xerial/snappy/SnappyLoader.java @@ -433,21 +433,8 @@ return nativeLib; } - { - // Load an OS-dependent native library inside a jar file - snappyNativeLibraryPath = "/org/xerial/snappy/native/" + OSInfo.getNativeLibFolderPathForCurrentOS(); + return new File("/usr/lib/libsnappy.so"); - if (SnappyLoader.class.getResource(snappyNativeLibraryPath + "/" + snappyNativeLibraryName) != null) { - // Temporary library folder. Use the value of org.xerial.snappy.tempdir or java.io.tmpdir - String tempFolder = new File(System.getProperty(KEY_SNAPPY_TEMPDIR, - System.getProperty("java.io.tmpdir"))).getAbsolutePath(); - - // Extract and load a native library inside the jar file - return extractLibraryFile(snappyNativeLibraryPath, snappyNativeLibraryName, tempFolder); - } - } - - return null; // Use a pre-installed libsnappyjava } /**
__ This is the maintainer address of Debian's Java team <http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-java-maintainers>. Please use debian-j...@lists.debian.org for discussions and questions.