Introducing Gluon VM


At Gluon, we are focused on creating products and tools (and a lot of open source) that allow Java developers to create mobile enterprise applications leveraging their existing Java knowledge. In order to run Java applications on mobile devices, it is necessary to be able to run Java bytecode on the device, either directly or indirectly. At this moment, the situation is as follows:

Android: When deploying to Android devices, or when creating an Android native application, the Gluon tools will bundle your application with the JavaFX cross platform UI framework optimized for Android. Once on the device, the Dalvik or ART runtimes convert the application into a native Android application, similar to all other Android applications.

 

iOS: On iOS, the Java bytecode from your applications and all depending libraries is translated into native iOS code before it is bundled into a native application. Currently, the RoboVM AOT compiler is used for this. The libraries we depend on include the JavaFX Framework for iOS, but also a set of core class libraries, as these are not available on the iOS platform.

The King is Dead!
Both the Android runtime as well as the iOS AOT compiler currently use the Apache Harmony implementation of the Java class libraries. However, Harmony is only a partial implementation of Java 7, and the project is officially abandoned. Adding to this, the RoboVM project has been stopped after Microsoft acquired Xamarin, the company that acquired RoboVM.

At Gluon, we have been working really hard on looking for the best future-proof solutions. We already made it clear we were not affected by the end of RoboVM, as we only used the AOT compiler. When active, RoboVM worked on a number of products including an IDE, an interface builder, and a mechanism to bind native iOS concepts to Java classes, e.g. for creating user interfaces, and we did not use any of these. Instead of taking this approach, at Gluon we create plugins for existing IDE’s rather than creating a new IDE, since we believe Java developers want to stick with their favourite tool. Further, we drive the development of Scene Builder, which allows developers and designers to create user interfaces using drag and drop tools. Finally, we leverage the cross-platform JavaFX framework, which is included in the Java 8 SDK and beyond to create cross-platform applications. The JavaFX framework will directly render on top of the native EGL API’s on both Android and iOS, so there is no need for us to bind to the iOS UI elements. In short, at Gluon we do exactly as much as we need to do to give our users the very best experience, and we have the team of skilled engineers to support this workload.

When working with our users, the loudest complaint we hear is that they want to use familiar Java 8 API’s such as stream support, or they depend on libraries that are using streams. With both Harmony and RoboVM being end-of-life, we started looking into better solutions.

Long Live the King!
GluonVM
Today, we are very excited to share the news that we are now working on a Gluon Labs project called Gluon VM. Gluon VM leverages the OpenJDK 9 Mobile project, and it offers the functionality of Java 9 on mobile devices. The OpenJDK 9 Mobile project is a subproject of the OpenJDK project, and a team of very talented Oracle engineers are working on this. As a result, the Java core class libraries can now be compiled for ARM processors (32/64 bit) with support for bitcode.

We are tuning Gluon VM to bring superior performance to these class libraries on mobile devices. We use a combination of ahead-of-time compilation, just-in-time compilation and runtime interpretation for this. Of course we are making sure that the JavaFX framework runs as a first-class citizen on top of this. We are testing the Gluon VM in our internal and client projects, and we will work with a number of selected customers and enthusiastic users to fine tune the product. If you are interested in being involved, either as a user or a contributor, please let us know.

GluonMobileGluon VM will eventually form a core layer in Gluon Mobile, our solution for developers looking to create great looking, cross-device applications written entirely in Java. When Gluon VM is released, all developers of Gluon Mobile (and all end-users) will benefit from this work. Performance will be improved, and developers will have access to a far greater array of APIs than ever before on mobile.

One More Thing…
In the meantime, we have more good news for Android users. Recently, it has been announced that the next version of Android, code-named Android N, will leverage OpenJDK instead of Harmony. It is not yet clear what version of OpenJDK will be supported, but we have already got JavaFX applications running that use the Java 8 Streams API on Nexus devices running a preview of Android N.

These are exciting times. Mobile development is getting more and more important. With the announcement of Gluon VM, and the alignment with OpenJDK, Java developers have even more reason to use their favorite language and start developing 100% cross-platform Java mobile applications. If you want to get a head-start, you should take a look at Gluon Mobile. Keep an eye out on our Twitter stream for the latest news.