henrikhorbovyi
04/10/2022, 3:17 PMThe operation could''t be completed. Unable to locate a Java Runtime.
Please visit <http://www.java.com> for information on installing Java.
Command PhaseScriptExecution failed with a nonzero exit code
From Android Studio I even can run it on an iOS emulator, but I can’t get preview or run it from xcode.
Anyone to help me on that 😄 ?sdkman
to manage my sdks (including JDK) and I installed through it
• if I type: javac -version
it shows the correct version that I’ve installed, but if I type: /usr/libexec/java_home -V
it shows
The operation couldn't be completed. Unable to locate a Java Runtime.
Which is the same message that appears on xcode logs.
Do you think it has something to do with JDK/JRE path?Adam S
04/10/2022, 8:14 PMecho $JAVA_HOME
return anything? I don't use XCode, but my guess is that it JAVA_HOME
isn't set, or XCode has some other way of setting itJames Black
04/10/2022, 8:40 PMhenrikhorbovyi
04/10/2022, 9:05 PMecho $JAVA_HOME
returns:
/Users/henriquehorbovyi/.sdkman/candidates/java/currentwhich java
also returns
/Users/henriquehorbovyi/.sdkman/candidates/java/current/bin/javaJames Black
04/10/2022, 10:04 PMhenrikhorbovyi
04/11/2022, 2:49 AMjava_home
can only identify a java path if it would come from a macOS normal installation (if I had downloaded a jdk.dmg for example)
How I solved:
• I solved the problem by adding a custom path called JAVA_HOME inside xcode locations preferences