From native code gems to Java treasures with jextract
summary
jextract parses C headers and generates Java FFM bindings so Java code uses native libraries directly; it ships separately but works with JDK 22+ and Java 24. Examples include calling localtime_r from libc (generated class time_h), embedding libpython3.11 and running a Python script via pyon bindings, rendering an OpenGL teapot after trimming ~4,000 symbols with dump-includes, and calling a Rust-produced C API (hello world). jextract can trace calls and show memory addresses and sizes for debugging.
AI-written summary · about
chapters (8)
- 0:00jextract and native Java
- 3:18Foreign Function Memory API
- 5:34Installing jextract
- 9:00Generating C bindings
- 15:09Python bindings with jextract
- 23:25OpenGL with jextract
- 36:28Rust libraries without headers
- 40:02Summary and future of FFM
related talks
33mFrom native code gems to Java treasures with jextract
11mExpanding Swift/Java Interoperability
36mA Promising Future for using Native Libraries in the Java World
47mInterconnecting Java and Native Code with the FFM API
01h 04mProject Panama Unleashing Native Libraries
29mEasily Leverage Native Functions with Project Panama from Java
44mGoing Meta to Valhalla & Panama
55mJava 19 Project Panama 4 Newbies
