RFR: 8374535: IOS uses different path for modules
Kolby Moroz Liebl
duke at openjdk.org
Sun Feb 1 22:48:06 UTC 2026
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.
-------------
Commit messages:
- Check the same jimage module path, which is used to read modules
Changes: https://git.openjdk.org/mobile/pull/43/files
Webrev: https://webrevs.openjdk.org/?repo=mobile&pr=43&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8374535
Stats: 4 lines in 1 file changed: 0 ins; 4 del; 0 mod
Patch: https://git.openjdk.org/mobile/pull/43.diff
Fetch: git fetch https://git.openjdk.org/mobile.git pull/43/head:pull/43
PR: https://git.openjdk.org/mobile/pull/43
More information about the mobile-dev
mailing list