Java Abstracted Foreign Function Layer
JNR-FFI is a Java library for loading native libraries without writing JNI code by hand, or using tools such as SWIG.
Latest version: Apache Maven:
com.github.jnr
jnr-ffi
x.y.z
Gradle Kotlin:
implementation("com.github.jnr:jnr-ffi:x.y.z")
Gradle Groovy:
implementation 'com.github.jnr:jnr-ffi:x.y.z'
import jnr.ffi.LibraryLoader;
public class HelloWorld {
public interface LibC { // A representation of libC in Java
int puts(String s); // mapping of the puts function, in C `int puts(const char *s);`
}
public static void main(String[] args) {
LibC libc = LibraryLoader.create(LibC.class).load("c"); // load the "c" library into the libc variable
libc.puts("Hello World!"); // prints "Hello World!" to console
}
}
View more details in our user documentation.
Deploy artifacts to Sonatype Central with the following command:
mvn clean deploy
Deploy release artifacts to Maven Central by updating the release version to remove -SNAPSHOT and running the following command:
mvn clean deploy -Prelease
Update the release version to the next snapshot after the release artifacts have been published.
…
No open issues yet, or sync has not completed.