A modern, type-safe abstraction over the Java Foreign Function & Memory (FFM) API.
ffmkit makes native interop on Java 22+ feel like a high-level library — not like programming the linker by hand.
| Group / package | io.github.undeffineddev.ffmkit |
| Module | io.github.undeffineddev.ffmkit |
| Java | 22+ |
| Build | Gradle |
| Status | 0.1.0-EXPERIMENTAL |
Since Java 22, the supported way to talk to native code is FFM (Project Panama) — the modern replacement for JNI. FFM is powerful, but:
- It is verbose and confusing for beginners (
Arena,Linker,FunctionDescriptor,MethodHandle, …) - Memory management is easy to get wrong
- Mapping C types ↔ Java by hand is repetitive
Then I thought about creating a small library to facilitate development
Warning
This is an experimental project, so expect breaking changes.
- Native C types — ABI mappings,
CChar,WChar,_Bool, and fluentNativeTypeconstants - Native functions
- Native loader
- Callbacks
- Structs
- Memory scopes and pointers, Pointer helpers
- Native arrays