RFR: 8374535: IOS uses different path for modules
Kolby Moroz Liebl
duke at openjdk.org
Sun Feb 1 22:48:07 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.
My contributor agreement is under review right now
-------------
PR Comment: https://git.openjdk.org/mobile/pull/43#issuecomment-3693780830
More information about the mobile-dev
mailing list