lz4 / lz4-java

LZ4 compression for Java
Apache License 2.0
1.1k stars 253 forks source link

Try to load lz4-java from java.library.path, then fallback to bundled #83

Closed jirutka closed 7 years ago

jirutka commented 8 years ago

Use system-provided lz4-java, if it's available on the java.library.path (the default location where Java looks for native libraries), and fallback to bundled binary if it's not. This allows user to use lz4 java even on systems that are not directly supported, like Linux with musl libc, uClibc etc.

jirutka commented 8 years ago

@jpountz Could you please look at this PR?

drcrallen commented 8 years ago

Would this be dangerous if the api used by the JNI hooks changed?

jirutka commented 8 years ago

Why dangerous? You just need to have correct (ABI compatible) version of the native lib. It’s the same as with any other dynamically linked library.

odaira commented 7 years ago

Merged.

Ideally, lz4-java should include every architecture's native library, but practically it is impossible, so I think it makes sense to have this feature.

amolskh commented 4 years ago

Can you elaborate how to give path to liblz4-java . when I am running jar

odaira commented 4 years ago

Place your liblz4-java.so to a directory. Suppose it is /path/to/your/library/directory. Then run java -Djava.library.path=/path/to/your/library/directory ....