JavaFX 27 Native Image on a Raspberry Pi 5
3 days ago
- JavaFX 27 can be deployed as a GraalVM Native Image with up to 90% reductions in startup and first visit times on both desktop and Raspberry Pi 5.
- Three tools exist for building JavaFX native images: Gluon Substrate, Liberica NIK, and the newly released StaticFX.
- All approaches must solve three core problems: reachability metadata, static libraries, and integration glue.
- StaticFX works with the latest JavaFX 27 and Oracle GraalVM, supports Media/WebView via dynamic linking, and is available on Maven Central.
- Benchmarks show Native Image reduces distribution size by 11%, time to first window by 86%, and private memory by 27–55% compared to jlink.
- Application metadata is a major pain point; reachability-annotations help maintain metadata alongside source code without needing a tracing agent.
- StaticFX enables running complex applications like AtlantaFX Sampler without a tracing agent on all platforms.
- Each tool differs in how it handles metadata (JSON files, code-patches, annotations) and static libraries (bundled, substituted, or user-specified).