Beyond OpenJDK builds, announcing openjdk-mobile.github.io
Johan Vos
johan.vos at gluonhq.com
Fri Aug 29 12:33:32 UTC 2025
Hi,
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.
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.
This is why Gluon created a GitHub-based project website:
https://openjdk-mobile.github.io, 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).
The openjdk-mobile.github.io 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:
* build libffi on iOS
* build OpenJDK for iOS
* create an Xcode framework based on the artifacts from the OpenJDK build
* use the created Xcode framework to run Java apps on iOS (no automation in
place yet)
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.
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).
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:
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.
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.
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.
Apart from this, the iOS steps need to be repeated on Android -- which is a
bit easier because we can use a JIT there.
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.
- Johan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.org/pipermail/mobile-dev/attachments/20250829/e2dea9b9/attachment-0001.htm>
More information about the mobile-dev
mailing list