Skip to content
Java helper for loading native libraries from jar files
Java C
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
src/com/nullprogram/guide
test/com/nullprogram/guide
.gitignore
README.md
UNLICENSE
build.xml
checkstyle.xml
pom.xml

README.md

This is a utility library for loading native libraries from the classpath. The JVM is unable to load libraries from inside .jar files. This class works around that by copying them out to a temporary directory on the filesystem.

When using this utility class, imagine you are registering all versions of your native library. It would be used like this,

try {
    NativeGuide.prepare(Arch.LINUX_32, "x86/libexample.so");
    NativeGuide.prepare(Arch.LINUX_64, "amd64/libexample.so");
    NativeGuide.prepare(Arch.WINDOWS_32, "x86/example.dll");
    NativeGuide.prepare(Arch.WINDOWS_64, "amd64/example.dll");
} catch (java.io.IOException e) {
    LOG.severe("Could not prepare the native libraries.");
    throw e;
}

Libraries not used by the running architecture are ignored.

See also:

Something went wrong with that request. Please try again.