Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
J

jnr-ffi

> 编程语言
Open source

Java Abstracted Foreign Function Layer

1.3K stars0 likes0 views
WebsiteGitHub

About

Java Abstracted Foreign Function Layer

JNR-FFI

JNR-FFI is a Java library for loading native libraries without writing JNI code by hand, or using tools such as SWIG.

Installation

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'

Example

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.

Releasing

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.

LICENSE

…

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言