For build instructions please see the online documentation, or either of these files:
- doc/building.html (html version)
- doc/building.md (markdown version)
See https://openjdk.org/ for more information about the OpenJDK Community and the JDK and see https://bugs.openjdk.org for JDK issue tracking.
Note
Follow the instructions in building.md to make sure you can build the JDK targeting macOS before trying to build for iOS
Following are the prerequisites to build JDK on Mac targeting iOS:
- Download and unzip pre-built JDK24 to be used as boot JDK
- Download the support zip which contains an ios build for libffi and cups. Unzip it in the root directory of the project.
- Install
autoconf
on mac via homebrew:brew install autoconf
Clone the openjdk/mobile repository. The following command can be used:
git clone [email protected]:openjdk/mobile.git
Modify the configure script below so that it has the correct paths to your JDK24 directory, the unzipped 'support' directory, and the correct location of the iPhoneOS.platform.
sh configure \
--with-conf-name=zero-ios-aarch64 \
--disable-warnings-as-errors \
--openjdk-target=aarch64-macos-ios \
--with-boot-jdk=/Users/abhinay/.sdkman/candidates/java/24.ea.29-open \
--with-jvm-variants=zero \
--with-libffi-include=<support-dir-absolute-path>/libffi/include \
--with-libffi-lib=<support-dir-absolute-path>/libffi/libs \
--with-cups-include=<support-dir-absolute-path>/cups-2.3.6
--with-sysroot=/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk \
Execute the make
command:
make CONF=zero-ios-aarch64 static-libs-image
Once the build is successful, it should have created a directory in build/zero-ios-aarch64/images/static-libs/lib/zero
with a file libjvm.a
.