RFR: 8374535: IOS uses different path for modules

Johan Vos jvos at openjdk.org
Sun Feb 1 22:48:08 UTC 2026


On Sat, 27 Dec 2025 06:57:36 GMT, Kolby Moroz Liebl <duke at openjdk.org> wrote:

> I spent like 20 hours debugging this. I am shipping an app for iOS which uses Java. The exploded modules works fine. But when I tried to publish my app I got this error https://github.com/openjdk-mobile/ios-tools/issues/61
> 
> So I then built a module file, but was getting this error that it couldn't find the module file. I read the code and found on iOS it looks at the `JAVA_HOME/Documents/lib/module` sure whatever I did that. And the JVM still failed to initialize. After debugging for what felt like forever
> 
> I found that https://github.com/openjdk/mobile/blob/205325c987df20d8d72372f45910137d61da0850/src/hotspot/share/classfile/classLoader.cpp#L1418-L1420 is hard code to search `Java_HOME/lib` which is what Default Java uses.
> 
> So I removed the custom pathing check for the module file for iOS which is seen in this PR diff and it worked 🥳 . I don't know why that `ifndef` was added, but I don't think it should be there. I think we should use the defaults for Java, as Java's JVM initialization errors aren't that helpful, so we shouldn't be doing magic for iOS. If I want my modules in `Documents` I will set my `JAVA_HOME` myself. Anyways thought I would make a PR to help out this cause 🔥. Also I am SO HAPPY my java app works now on iOS. Thank you guys so much <3.
> 
> **TLDR** Jimage module file exists check for iOS is different then Jimage module path we read from.

Thanks for this PR. The location of the (exploded) modules is an issue indeed, and I'm unsure about the best approach here. I'll check my local notes to see why I added the ifndef regarding `Documents` being in the path.

I created https://bugs.openjdk.org/browse/JDK-8374535 for this. The PR should have the same name as the issue title.

Once OCA is processed (give that a week), this can be integrated.

-------------

PR Comment: https://git.openjdk.org/mobile/pull/43#issuecomment-3694868023
PR Comment: https://git.openjdk.org/mobile/pull/43#issuecomment-3711119648
PR Comment: https://git.openjdk.org/mobile/pull/43#issuecomment-3718723110


More information about the mobile-dev mailing list