# How to fix the "Unable to locate a Java Runtime" error on Xcode with Kotlin Multiplatform

DevFeed: [How to fix the "Unable to locate a Java Runtime" error on Xcode with Kotlin Multiplatform](<https://devfeed.tech/articles/how-to-fix-the-unable-to-locate-a-java-runtime-error-on-xcode-with-kotlin-multiplatform-25558.md>)

Original publisher: [Read original article](<https://www.marcogomiero.com/posts/2021/kmp-no-java-runtime-error-xcode/>)

Author: Marco Gomiero

Published: 2021-12-27T00:00:00Z

Content type: tutorial

Language: en

Sources: [Posts on Marco Gomiero](<https://devfeed.tech/sources/posts-on-marco-gomiero.md>)

Topics: [Kotlin Multiplatform](<https://devfeed.tech/topics/kotlin-multiplatform.md>), [Xcode](<https://devfeed.tech/topics/xcode.md>), [iOS](<https://devfeed.tech/topics/ios.md>), [Java](<https://devfeed.tech/topics/java.md>), [Kotlin](<https://devfeed.tech/topics/kotlin.md>), [Android Studio](<https://devfeed.tech/topics/android-studio.md>), [IntelliJ IDEA](<https://devfeed.tech/topics/intellij-idea.md>), [simulator](<https://devfeed.tech/topics/simulator.md>)

Tags: [android](<https://devfeed.tech/tags/android.md>), [android-studio](<https://devfeed.tech/tags/android-studio.md>), [install](<https://devfeed.tech/tags/install.md>), [installation](<https://devfeed.tech/tags/installation.md>), [intellij](<https://devfeed.tech/tags/intellij.md>), [ios](<https://devfeed.tech/tags/ios.md>), [java](<https://devfeed.tech/tags/java.md>), [java-8](<https://devfeed.tech/tags/java-8.md>), [jdk](<https://devfeed.tech/tags/jdk.md>), [kotlin](<https://devfeed.tech/tags/kotlin.md>), [kotlin-multiplatform](<https://devfeed.tech/tags/kotlin-multiplatform.md>), [library](<https://devfeed.tech/tags/library.md>), [simulator](<https://devfeed.tech/tags/simulator.md>), [xcode](<https://devfeed.tech/tags/xcode.md>)

## AI overview

A tutorial explains how to resolve Xcode's "Unable to locate a Java Runtime" build error when running a Kotlin Multiplatform project on the iOS simulator. The author found that the JDK installation method affected Xcode's Java runtime detection and restored builds with a manual installation; explicitly setting JAVA_HOME in plist files is also mentioned as an alternative.

## Source excerpt

A couple of days ago I opened my Kotlin Multiplatform pet project MoneyFlow on a different machine than usual. When I tried to run the app on the iOS simulator on Xcode, the build failed with a very strange error: "The operation couldn't be completed. Unable to locate a Java Runtime". This was a very strange issue because the JDK is installed and everything is working on the command line and Android Studio/IntelliJ.