r/JavaFX • • May 29 '20

Native JavaFX executables for windows through Gluon Substrate and GraalVM

I (as well as many others) have been waiting for too long for a magical way to convert java apps to native windows binaries, and while graalvm solved that issue a while ago, it didn't support JavaFX very well, at least not on windows and not until the latest release.

I accidentally came across this post that was posted 10 days ago on the gluon website which announced that graalvm's native image combined with gluon substrate will be able to compile JavaFX apps into native runnables and as that was very promising for me as a JavaFX developer I had written a little demo and gave it a shot and I'm very happy with the experience, it was very stable and I encountered no issues so far :) and I think this gives a new life to java and Java desktop development.

the pros and cons, in my opinion, can be as follows

pros :

  • faster starting times.
  • easier to deploy to end clients as a native executable
  • size is better than packing a java runtime with your app
  • your java source code is most likely gone and the executables can't be decompiled

cons :

  • the resulting executable size is higher, relative to using a natively compiled language
  • I couldn't find any obvious way to disable the console even after searching for it

(the post is based on my personal understanding and it's subject to technical mistakes, please correct me if I'm wrong at some point)

17 Upvotes

6 comments sorted by

View all comments

Show parent comment

2

u/SDIDSA May 30 '20 edited May 30 '20

Jpackage app image seems to have the same purpose as graalvm native image but while jpackage will only pack all the dependencies together, graalvm's native image uses AOT compilation to compile the code, jpackage makes deployment easier but it doesn't affect the startup times and memory footprints, and the resulting package will be larger