<div dir="ltr"><div>Hi,</div><div><br></div>With the work being done in the openjdk/mobile project, it is now possible to build the OpenJDK sources targeting mobile platforms. That by itself is a great outcome.<br><br>However, there is still a significant gap between a platform-specific build of OpenJDK and a Java-based application running on that platform. In the server/cloud world, there is a lot of effort going into deploying and managing Java applications on cloud systems. On mobile, the situation is different from the server, but additional work is still needed.<br><br>This is why Gluon created a GitHub-based project website: <a href="https://openjdk-mobile.github.io">https://openjdk-mobile.github.io</a>, where the steps between a build of OpenJDK Mobile and a running HelloWorld application are explained and discussed. I deliberately want this to be a community effort, rather than a Gluon-only initiative. I don't think the contents of this website belong in the openjdk/mobile repository, similar to how, for example, Kubernetes is not part of OpenJDK. I do hope, though, that OpenJDK developers from different companies will participate in this effort (and I'm very open to discuss what should be in OpenJDK/mobile and what not).<br><br>The <a href="http://openjdk-mobile.github.io">openjdk-mobile.github.io</a> website is part of the openjdk-mobile organization I created on GitHub. I also created another repository under that organization, named ios-tools. In this repository, we developed a number of GitHub Actions and scripts that automate most of the process to run Java apps on ios:<br><br>* build libffi on iOS<br>* build OpenJDK for iOS<br>* create an Xcode framework based on the artifacts from the OpenJDK build<br>* use the created Xcode framework to run Java apps on iOS (no automation in place yet)<br><br>Each of these steps is briefly explained, and readers can either download the artifacts or build them themselves. There are nightly builds in place that build everything from source code. As a consequence, we immediately detect regressions in the different parts. This is one of my key focus areas: maintainability. I don't want to patch a specific version of OpenJDK just to run on a specific version of iOS; I would rather have the head of openjdk/mobile continuously work on iOS.<br><br>The website is a work in progress. Gluon developers contribute to it, but as mentioned, I hope others will contribute as well. We currently have a working pipeline for running HelloWorld on an iOS device, but there is still plenty of work to do (e.g., support for the iOS simulator and Android).<br><br>I realize there is still a big difference between a HelloWorld application that prints something on the console and a feature-rich mobile consumer app. The process we are following, however, allows different steps to be worked on in parallel:<br><br>1. We can now run HelloWorld on iOS using the zero interpreter, without AOT or any optimization. This can be improved, and thanks to the build pipelines we can now detect regressions. I am personally very eager to see integrations of Leyden-based work.<br><br>2. We can add JavaFX applications. We've done this before, and there is no showstopper to doing it again. However, I want to achieve the same level of quality that we now have in openjdk/mobile. I don't want any mobile-specific patch in JavaFX that is not 100% understood and justified. Again, maintainability is key.<br><br>3. We can convert Java libraries into native mobile libraries. This requires an approach to annotating Java methods that need to be exposed to consumers of the resulting native libraries.<br><br>Apart from this, the iOS steps need to be repeated on Android -- which is a bit easier because we can use a JIT there.<br><br>There is a lot of work to be done, and we don't have the same level of resources as those invested in Java in cloud/server environments. I don't expect miracles -- but no miracle is needed to run Java as a first-class citizen on mobile platforms. Java was designed to do this job; it's just a matter of making it happen.<br><div><br></div><div>- Johan</div></div>