Skip to content
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
odaira merged 1 commit into
lz4:masterfrom
jirutka:patch-1
Apr 28, 2017
Merged

Try to load lz4-java from java.library.path, then fallback to bundled#83
odaira merged 1 commit into
lz4:masterfrom
jirutka:patch-1

Conversation

@jirutka

@jirutka jirutka commented Apr 7, 2016

Copy link
Copy Markdown
Contributor

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.

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

jirutka commented May 16, 2016

Copy link
Copy Markdown
Contributor Author

@jpountz Could you please look at this PR?

@drcrallen

Copy link
Copy Markdown
Contributor

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

@jirutka

jirutka commented Jul 14, 2016

Copy link
Copy Markdown
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.

@odaira
odaira merged commit 2e1ef88 into lz4:master Apr 28, 2017
@odaira

odaira commented Apr 28, 2017

Copy link
Copy Markdown
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.

@amolskh

amolskh commented Sep 4, 2020

Copy link
Copy Markdown

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

@odaira

odaira commented Sep 4, 2020

Copy link
Copy Markdown
Member

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 ....

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants