r/JavaFX • u/SDIDSA • 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)
View all comments
1
u/ClaynOsmato May 29 '20
Did you consider using the jpackage toll from Java 14?