talira

Java Native Access (JNA)

Call native shared libraries from Java with plain Java interfaces, no JNI code

open sourceApache-2.0 OR LGPL-2.1-or-laterfree

Java Native Access (JNA) lets Java programs call functions in native shared libraries without writing JNI or native code, much like Windows' Platform/Invoke or Python's ctypes. You describe the library's functions and structures as a Java interface, and JNA's small JNI stub invokes them dynamically. It also ships a platform library with many native functions already mapped. Apache Cassandra, Elasticsearch, IntelliJ IDEA and Apache NetBeans are among the projects that use it.

Problems it solves

  • call a C library from Java without writing JNI
  • use operating system APIs from a Java application
  • load a native shared library in a JVM app

Features

  • call native functions through ordinary Java interfaces
  • no JNI or native code to write or build
  • maps native structures as Java classes
  • platform library with many native functions already mapped

Alternatives

The same job

These do what Java Native Access (JNA) does.

  1. rJava Low-level bridge from R to Java

Compare Java Native Access (JNA) with the top 3