# multiplatform

Francis Mariano

03/15/2023, 8:39 PM
hello everyone. I open the project in XCODE and I get the following ERROR:
ERROR: JAVA_HOME is set to an invalid directory
. So, I updated the environment variable to match the new local, but xcode is not processing the update. I already restart the macOS. Any idea?


03/15/2023, 8:42 PM
But if anyone has a better solution I'll take it

Francis Mariano

03/16/2023, 10:55 AM
ok martin, I will try. Xcode could be easier.


03/16/2023, 1:30 PM
the installed JAVA should be visible in macOS > JavaVirtualMachines Library, we can check it using:
$ ls -l /Library/Java/JavaVirtualMachines
If it's not there try installing java/openjdk using homebrew then symlink it to the JavaVirtualMachines Library.
$ brew install java
$ sudo ln -sfn /opt/homebrew/opt/openjdk/libexec/openjdk.jdk /Library/Java/JavaVirtualMachines/openjdk.jdk

Rodrigo Munera

10/06/2023, 4:34 PM
Had a similar issue running the iOS app from android studio today and this had me in the right track. We use asdf for our java version management for our repos, and the manifest of the ios app somehow picked up the .asdf java home version and hardcoded it to the project. I then uninstalled asdf, installed the version of java I wanted to use in the JavaVirtualMachines folder, and had to manually change the manifest files of the project to get android studio to finally build and launch the ios simulator...
👍 1