hn.today

JavaFX 27 Native Image on a Raspberry Pi 5

ennerf.github.io4 points0 comments
Screenshot of JavaFX 27 Native Image on a Raspberry Pi 5

Shows how JavaFX 27 can be built as a GraalVM native image and run on a Raspberry Pi 5, demonstrating large startup and memory wins from ahead-of-time (AOT) compilation versus traditional JIT builds. Benchmarks on the AtlantaFX sampler show native-image cutting time-to-first-window from 3.6 s (jlink) to 0.5 s and first WebView visit from ~2.4 s to 0.22 s, while reducing private memory after startup by ~27% and after full page load by ~55%. JavaFX, including WebView, MediaPlayer and AWT integration, runs well once configured, but getting a complex GUI working with native-image requires solving substantial build-time problems and careful debugging.

Compares three solutions: Gluon Substrate (broad, mobile-and-desktop toolchain that handles many platforms but is complex, brittle, and lags newer JavaFX), BellSoft Liberica NIK (desktop-focused GraalVM distro that bundles JavaFX for quick starts but omits media/web support and linux-aarch64), and StaticFX (a new GraalVM Feature that provides static archives and glue without patching JavaFX sources, supports dynamic linking and all JavaFX modules, and targets GraalVM-supported platforms). Identifies three core challenges: reachability metadata for reflection/resources, building static native JavaFX binaries, and integration glue for static linking/initialization; notes application metadata tracing is especially painful for GUIs and motivates using Oracle GraalVM enterprise features for better optimizations.

Read on ennerf.github.io0 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in Programming

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.