NativeGuide

Helper for loading native libraries from resources.

License

License

Categories

Categories

IDE Development Tools GUI User Interface Native
GroupId

GroupId

com.nullprogram
ArtifactId

ArtifactId

native-guide
Last Version

Last Version

0.3
Release Date

Release Date

Type

Type

jar
Description

Description

NativeGuide
Helper for loading native libraries from resources.
Project URL

Project URL

http://nullprogram.com/NativeGuide/
Source Code Management

Source Code Management

https://github.com/skeeto/NativeGuide

Download native-guide

How to add to project

<!-- https://jarcasting.com/artifacts/com.nullprogram/native-guide/ -->
<dependency>
    <groupId>com.nullprogram</groupId>
    <artifactId>native-guide</artifactId>
    <version>0.3</version>
</dependency>
// https://jarcasting.com/artifacts/com.nullprogram/native-guide/
implementation 'com.nullprogram:native-guide:0.3'
// https://jarcasting.com/artifacts/com.nullprogram/native-guide/
implementation ("com.nullprogram:native-guide:0.3")
'com.nullprogram:native-guide:jar:0.3'
<dependency org="com.nullprogram" name="native-guide" rev="0.3">
  <artifact name="native-guide" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.nullprogram', module='native-guide', version='0.3')
)
libraryDependencies += "com.nullprogram" % "native-guide" % "0.3"
[com.nullprogram/native-guide "0.3"]

Dependencies

There are no dependencies for this project. It is a standalone project that does not depend on any other jars.

Project Modules

There are no modules declared in this project.

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:

Versions

Version
0.3
0.2
0.1-RELEASE