Easily Leverage Native Functions with Project Panama from Java
summary
Shows how to call native C/Swift/Rust libraries directly from Java using JEP-419 (Foreign Function & Memory API) and the system linker, allocating MemorySegment arenas and invoking native symbols via generated MethodHandles. Demonstrates using jextract to generate bindings for libs like libsodium and a Rust blake3 implementation, enabling native access flags and incubator modules in JDK 18/19 previews, and argues this Panama approach is faster and simpler than JNI/JNA while using native memory scopes that auto-free.
AI-written summary · about
chapters (9)
- 0:00Project Panama intro
- 2:11Project evolution
- 6:46FJEP 419 features
- 8:10Panama config
- 13:36Practical demo: getpid
- 19:40Calling printf
- 23:58Native string handling
- 26:07Advanced use cases
- 28:37Q&A
related talks
01h 04mProject Panama Unleashing Native Libraries
36mA Promising Future for using Native Libraries in the Java World
55mJava 19 Project Panama 4 Newbies
16mForeign Function and Memory API
33mFrom native code gems to Java treasures with jextract
01h 01mJava Enable Preview: Foreign Function and Memory Interface
55mBare metal Java
45mProject Panama - Foreign Function & Memory API
