r/java • u/sureshg • Oct 10 '26
JDK team is working on creating a single-native executable image using jlink
https://youtu.be/fXBGBovpH88?t=622
147
Upvotes
r/java • u/sureshg • Oct 10 '26
View all comments
13
u/emberko Oct 10 '26
That’s honestly the best news in a very long time. Image size may not matter much for hosted apps, but for CLI and desktop apps it really does, esp the ability to distribute them as a single binary. Still, 35 MB is 2-3x worse than the alternatives: both Go and Rust typically produce single binaries of 10-20 MB, and even Python with PyInstaller can come in under 20 MB.
I wonder if it would be possible to strip some native code from the bundle. For example, why include each of the 5 GCs the JVM supports when an app usually uses just one, and it’s rarely something as niche as Shenandoah?
Another question is how this correlates with CDS, which requires you to generate a ~10 MB JSA file and distribute it with your app, and with the Leyden AOT cache, which needs even more disk space.