Jextract - Java Treasures from Native Code Gems

Published: 25 October 2024
on channel: Java
8,717
224

When developing a Java application, there can be use cases when you need access to system-level APIs and libraries written in other programming languages ( C, OpenGL, Tensorflow, Rust, Python, etc.). Project Panama is designed to facilitate access to native libraries, particularly those developed in C/C++, from Java code.

Interaction between the JVM and the "foreign" (non-Java) APIs has been made simpler with Foreign Function and Memory API (FFM API). The FFM API became a final feature in JDK 22, and it comes with a little gem - the jextract tool - that can automate obtaining access to native code. jextract parses header files (.h) of native libraries and generates Java code, named bindings that use the FFM API internally.

This talk will walk you through working with jextract and how to directly use its output as a Java model of the native libraries you are interested in.

Presented by Ana-Maria Mihalceanu - Java Developer Advocate (Java Platform Group - Oracle) during Devoxx Belgium 2024 ➤ https://devoxx.be

Resources
Tutorial ➱ https://dev.java/learn/jvm/tools/comp...
jextract binaries ➱ https://jdk.java.net/jextract/
Build the latest version of jextract ➱ https://github.com/openjdk/jextract
jextract samples ➱ https://github.com/openjdk/jextract/t...
Calling a rust library with the Panama FFI ➱ https://jornvernee.github.io/java/pan...
And more... ➱    • Foreign Function & Memory API - A (Quick) ...  

Tags: #Java #OpenJDK #Panama


On this page of the site you can watch the video online Jextract - Java Treasures from Native Code Gems with a duration of hours minute second in good quality, which was uploaded by the user Java 25 October 2024, share the link with friends and acquaintances, this video has already been watched 8,717 times on youtube and it was liked by 224 viewers. Enjoy your viewing!