First PR integrated in openjdk/mobile

Johan Vos johan.vos at gluonhq.com
Fri May 15 14:30:45 UTC 2020


Hi,

It took a while to get everything ready, but we now have the OpenJDK Mobile
repository at https://github.com/openjdk/mobile capable of creating java
static libraries for iOS and Android.

https://github.com/openjdk/mobile is auto-synced from openjdk/jdk and thus
contains all the code that is in the JDK.
Today, I merged a PR that enables building the static java libs:
https://github.com/openjdk/mobile/pull/4

The next goal is to upstream this PR to openjdk/jdk, but that is a
different story.

I will update the wiki page with instructions, but configuring and building
is relative straightforward. The JDK build now allows to run

make static-libs-image

which creates static JDK libraries (hence no JVM). With the merged PR, you
can build static libraries for iOS and Android. These can be used at
runtime on those devices.

Going from the java static libraries to apps for mobile requires of course
additional steps. Those steps are not in scope of the OpenJDK Mobile
project, but to give an example: we (Gluon) do this by linking code
generated with GraalVM native-image with the Java static libraries. We do
this in Gluon Substrate, which is open-source at
https://github.com/gluonhq/substrate and samples are given at
https://github.com/gluonhq/client-samples
<https://github.com/gluonhq/substrate>
Note that we include the JavaFX static libraries in those samples, so that
we have an end-to-end OpenJDK based stack for mobile (including
cross-platform UI). The JavaFX static libraries are built using 100% the
code from OpenJFX.

The merged PR is remarkably small, and is mainly based on code from Bob
Vandette who did this work for the Java 9 project.
Thanks to the auto-sync from upstream jdk (done by the Skara bot), we now
have the latest JDK code working for mobile. Pretty cool.

I'd like to thank the Skara team for their innovative work, and the OpenJDK
team at Oracle who helped in achieving this milestone.

Now we can really move things forward.

- Johan


More information about the mobile-dev mailing list