Earlier this week, Oracle released GraalVM 19.3. One of the great components in this release is GraalVM Native Image. With this tool, it is possible to convert Java applications (or by extension, all code written in a language that can run on top of GraalVM) into native applications. A native application does not need a Java Virtual Machine (JVM) anymore at runtime, as the translation between Java bytecode and code that is native to the target system (e.g. Mac, Linux, Windows, iOS, Android, embedded devices) is performed during build time.
There are a number of benefits to this approach. It removes the need for the end-user to have a Java Virtual Machine installed, the memory footprint is much smaller, and the startup time is excellent, as the code does not need to go through additional compile steps at runtime.
Clearly, there are many JavaFX applications that would benefit from this approach. A single executable, with a small memory footprint and almost immediate startup is very appealing in the area of client applications.
Today, we are very excited to announce Gluon Substrate, a framework that leverages GraalVM Native Image and that converts JavaFX applications into native executables. At this moment, Gluon Substrate can create executables for Linux and MacOS. With the GraalVM 19.3 release, there is experimental support for Windows as well, and we expect to add Windows soon to the list of supported platforms.
Moreover, Gluon Substrate is also capable of converting JavaFX applications into native mobile apps for both iOS and Android devices, as well as for embedded (ARM-based) devices. This functionality is still very experimental, but we are confident we can enable it by default in a few months from now.
The architecture of Gluon Substrate is shown below:
Under the hood, JavaFX applications are a bit complex. They require not only Java code, but also resources (e.g. css/FXML files, images, resource bundles) and the JavaFX platform itself. The JavaFX platform contains code that is specific to the native operating system. We created static libraries based on the OpenJFX code. Substrate combines all of this in order to create a native executable.
To make it even easier for developers, we created a Maven plugin that allows you to perform all this magic with a simple modification in a pom.xml file.
If you want to try it out yourself, have a look at the samples in http://github.com/gluonhq/client-samples and follow the instructions.
At this moment, Gluon Substrate will use the latest JavaFX code and bundle it with your application. Gluon JavaFX 11 LTS customers can also use the latest JavaFX 11.0.5 build, which comes with an SLA.
Gluon Mobile customers will be able to use their existing Gluon Mobile subscriptions to build shiny mobile applications leveraging the mobile-specific UI controls that we provide.