News

Open Source Compiler for Java to iOS Released

The first stable release (1.0) of the RoboVM ahead-of-time (AOT) compiler and runtime library for Java is now available.

Developed by Swedish company Trillain Mobile, the open-source tool is designed to bring Java and other JVM languages to iOS.

The company says its goal is to "turn the world's 10 million Java developers into cross-platform mobile developers by making Java 8 work on both iOS and Android devices."

Based on Android's runtime, RoboVM translates Java bytecode to ARM or x86 machine code without being interpreted. The result is code that runs directly on the target CPU.

Although the primary target of this release is Java on iOS, RoboVM can produce Linux and Mac OS X x86 executables, the company says. Currently, a Mac and XCode are required to use RoboVM.

Along with Java, the list of JVM languages supported by RoboVM includes Scala, Kotlin, Groovy and Clojure.

This release comes with a Java-to-Objective-C bridge (called "Bro," which is Swedish for "bridge") that supports calls into native iOS CocoaTouch APIs. Objective-C objects can be used as though they are Java objects. The company claims Bro is simpler and easier to use than JNI (Java Native Interface) when it comes to interfacing with iPhone and iPad hardware, and for such iOS services as in-app purchasing and notifications.

According to the company, this release also includes an improved debugger with complete JDWP (Java Debug Wire Protocol) functionality (as part of a commercial license), which allows devs to debug a Java process from inside an IDE. It supports HFS+ file compression, includes a new Eclipse project wizard, and provides Maven archetype support.

The open-source RoboVM project tools are GPLv2 licensed. The runtime component is licensed primarily under the Apache License v2.0. Trillain Mobile maintains the open-source RoboVM technology, and sells commercial licenses and additional support packages.

A RoboVM for Eclipse plugin, which integrates the AOT compiler with the Eclipse Java IDE, is available from the Eclipse Marketplace. Eclipse is the product's default development environment. "Using the plug-in, launching apps on the simulator or on an iOS device is as easy as launching ordinary Java applications," the company says.

Also, the company has just released an alpha build of a RoboVM plugin for the Intellij IDEA Java IDE. RoboVM is also supported in Android Studio.

The company said it plans to include integration with the Xcode Interface Builder in the next release, due in Q2. It will be offered as a commercial feature, the company says.

About the Author

John K. Waters is the editor in chief of a number of Converge360.com sites, with a focus on high-end development, AI and future tech. He's been writing about cutting-edge technologies and culture of Silicon Valley for more than two decades, and he's written more than a dozen books. He also co-scripted the documentary film Silicon Valley: A 100 Year Renaissance, which aired on PBS.  He can be reached at [email protected].