OpenJDK Plans to Bring Java to iOS: What It Means
OpenJDK is working to bring Java to iOS through the OpenJDK Mobile project. Here is what runs today, what is still missing, and what it means for Java teams.
On this page
Short answer
The OpenJDK Mobile project is working to bring Java to iOS by building the OpenJDK runtime for Apple devices. A small HelloWorld program already runs on a real iPhone using the Zero interpreter, with ahead-of-time compilation from Project Leyden planned to add speed, but full apps, JavaFX support and App Store packaging are still in progress.
What is the plan to bring Java to iOS?
The plan to bring Java to iOS is an effort inside the OpenJDK Mobile project to build the OpenJDK sources so they run on Apple phones and tablets. OpenJDK is the free, open-source implementation of the Java platform, and the mobile project adapts its build system and runtime so the same Java code that runs on servers can run on iOS.
The work is a community effort, led in practice by the company Gluon, with the stated goal of sending every change back into the main OpenJDK project rather than keeping a separate fork. A project site at openjdk-mobile.github.io documents the steps from an OpenJDK build to a working app.
Progress is real but early. A small HelloWorld program already runs on a physical iPhone, using the Zero interpreter, and automated build pipelines now catch regressions. Full applications, a user interface toolkit and App Store packaging are still being worked on.
Why has Java never run on iOS?
Java has never run on iOS because Apple's rules for the App Store forbid just-in-time compilation, and a normal Java virtual machine depends on it. The JVM compiles Java bytecode into native code while the program runs, which Apple treats as running downloaded code, so a standard JVM cannot ship inside an App Store app.
Android took the opposite path. It was built around Java from the start, so Java developers could write Android apps with familiar tools. Apple never shipped a JVM for iOS, and the few third-party routes that existed, such as RoboVM, stopped being maintained.
The gap matters because Java is one of the most widely used languages for business software. Companies with large Java codebases and Java teams have had to learn Swift or Objective-C, or hire separately, to reach iPhone users. The OpenJDK Mobile project exists to close that gap without asking teams to abandon Java.
How does the OpenJDK Mobile approach work?
The OpenJDK Mobile approach works by combining a portable interpreter with ahead-of-time compilation, so Java code runs on iOS without breaking Apple's rules. The table below shows the pieces and what each one does.
| Piece | What it does | Why it matters on iOS |
|---|---|---|
| Zero interpreter | Runs Java bytecode without platform-specific code | Works on iOS with no JIT and no assembly |
| Project Leyden | Compiles performance-critical code ahead of time | Adds speed where the interpreter is slow |
| GraalVM native image | Builds a native executable at build time | Packages Java code the way Apple expects |
| Xcode framework | Wraps the OpenJDK build for Xcode | Lets iOS tooling link and ship the app |
| JavaFX | Provides the user interface toolkit | Supplies screens, controls and graphics |
The Zero interpreter is the foundation. It is written in plain C++ with no platform-specific assembly, so it builds for iOS as it stands, and it runs the full Java language. Its weakness is speed, which is where ahead-of-time compilation comes in: the parts of a program that need to be fast are compiled before the app ships, while the interpreter handles the rest.
GraalVM native image plays a similar role. It compiles Java code at build time into a native executable, which is how earlier Java-on-iOS experiments worked, and it remains part of the toolkit alongside the newer Leyden work.
What works today, and what is still missing?
What works today is a working pipeline: the OpenJDK sources build for iOS, the result runs a HelloWorld program on a real device, and automated builds catch regressions when the code changes. That is a genuine milestone, because building a modern JVM for a new platform at all is hard work.
What is still missing is most of what a real app needs. Support for the iOS simulator is still being added, which matters because developers test on simulators far more than on devices. JavaFX applications are a stated goal, but the toolkit still needs full integration with iOS graphics. Performance tuning through Project Leyden is also still early.
The packaging question is open too. Getting a Java app through App Store review will depend on how the final binary is built and whether Apple accepts the approach. The project aims to keep everything in the open, so these questions are being worked through in public.
What does this mean for Java developers?
For Java developers, the plan means the skills and libraries they already have could one day reach iPhones without a rewrite. A team that maintains a Java library for pricing, routing or data validation could reuse it inside an iOS app instead of writing the same logic twice in Swift.
That matters most for business apps, where the hard part is usually the logic and the data, not the animation. Field service, logistics, banking and internal tools are the natural first uses, because their screens are forms, lists and dashboards rather than games.
It does not mean Swift goes away. Apple builds its newest features for Swift first, and apps that need the latest iOS capabilities will still need native code. The realistic outcome is a choice: write the shared logic once in Java, and write the parts that need Apple frameworks in Swift.
How would a Java app reach an iPhone?
A Java app would reach an iPhone through a build pipeline that turns Java code into an iOS package. The steps below describe the path the OpenJDK Mobile project documents.
- Build OpenJDK for iOS. Compile the OpenJDK sources with the iOS target, using the project's build scripts.
- Wrap it as an Xcode framework. Package the runtime so Xcode can link it into an iOS app.
- Compile the app code ahead of time. Use ahead-of-time compilation for the performance-critical parts.
- Add the user interface. Use JavaFX, or call native iOS views for screens that need Apple frameworks.
- Test on a real device. Run the app on an iPhone, since the simulator path is still being finished.
- Package and submit. Build the app the way Xcode expects and send it through App Store review.
Today only the first steps are routine. The project supplies scripts and GitHub Actions that automate much of the build, but assembling a finished app still needs manual work and a good understanding of both Java and iOS tooling.
Example (hypothetical): a logistics team reuses its Java engine
Example (hypothetical): a logistics company runs its route planning in Java, with 6 developers maintaining the planning engine. Its drivers use iPhones, and the company wants the same planning logic in a driver app instead of paying for a separate Swift rewrite.
The team estimates a Swift rewrite of the engine at 4 months of work for 2 developers, or about 8 developer-months. With Java on iOS, the same engine ships inside the iPhone app, and the team spends its time on the driver screens instead. If the driver screens take 6 weeks, the project finishes in about half the time of a full rewrite.
The saving is not free. The team still needs someone who understands Xcode, App Store review and iOS design patterns. But the planning logic, the part the team knows best, stays in one place, and a fix to the engine reaches the server and the phone together.
What are the common mistakes?
The most common mistakes with Java on iOS are assuming it is ready for production, ignoring Apple's rules, and expecting Swift to disappear.
- Treating an early project as production-ready. The pipeline runs HelloWorld on a device, but simulators, JavaFX and performance work are still in progress.
- Assuming JIT will be allowed. Apple's ban on just-in-time compilation is the reason the project uses an interpreter and ahead-of-time compilation.
- Planning a full rewrite in Java. The parts that need Apple frameworks still need native code.
- Skipping device testing. Simulator support is still being added, so real-device testing is the only reliable check.
- Ignoring App Store review. How Apple reviews a Java-built app is still an open question.
Key takeaways
- The OpenJDK Mobile project builds the OpenJDK runtime for iOS, led in practice by Gluon
- A HelloWorld program already runs on a real iPhone using the Zero interpreter
- Apple's ban on just-in-time compilation is why the project uses an interpreter plus ahead-of-time compilation
- JavaFX support, simulator support and App Store packaging are still being worked on
- The realistic outcome is shared Java logic with native Swift for Apple-specific features
Frequently asked questions
What is the OpenJDK Mobile project?
The OpenJDK Mobile project adapts the OpenJDK build system and runtime so Java code runs on mobile platforms, with iOS as the main focus. It is a community effort led in practice by Gluon, and its stated goal is to send every change back into the main OpenJDK project rather than keeping a separate fork.
Why can a normal JVM not run on iOS?
Apple's App Store rules forbid just-in-time compilation, and a normal JVM compiles bytecode while the program runs. The OpenJDK Mobile project works around this with the Zero interpreter, which runs bytecode without JIT, plus ahead-of-time compilation from Project Leyden for the parts that need speed.
Can I write iOS apps in Java today?
Not yet for production. You can build OpenJDK for iOS and run a small program on a real device, but simulator support, JavaFX integration and App Store packaging are still in progress. The project is worth following, but teams should not plan a launch around it today.
What is the Zero interpreter?
The Zero interpreter is a version of the JVM interpreter written in plain C++ with no platform-specific assembly code. Because it has no assembly and needs no JIT, it builds and runs on iOS as it stands, and it runs the full Java language, though more slowly than a JIT-compiled JVM.
What is Project Leyden's role?
Project Leyden is an OpenJDK effort to improve ahead-of-time compilation, so performance-critical Java code can be compiled before an app ships. On iOS it supplies the speed the Zero interpreter lacks, and the combination of the two is the project's path to usable performance.
Will Java replace Swift on iOS?
No. Apple builds its newest features for Swift first, and apps that need the latest iOS capabilities will still need native code. The realistic outcome is a mix: shared business logic written once in Java, with native Swift for the parts that need Apple frameworks.