This repository was archived by the owner on Dec 2, 2025. It is now read-only.
Try to load lz4-java from java.library.path, then fallback to bundled - #83
Merged
Conversation
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.
Contributor
Author
|
@jpountz Could you please look at this PR? |
Contributor
|
Would this be dangerous if the api used by the JNI hooks changed? |
Contributor
Author
|
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. |
Member
|
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. |
|
Can you elaborate how to give path to liblz4-java . when I am running jar |
Member
|
Place your liblz4-java.so to a directory. Suppose it is |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 evenon systems that are not directly supported, like Linux with musl libc, uClibc etc.