Similar to: - Intellij 14 the supplied javaHome seems to be invalid - Android Studio - supplied javaHome is not a valid folder
However, I am trying to use
in IntelliJ 2018.1, I ran into this problem because my project SDK was set to Kotlin instead of a JDK. So, despite having a Kotlin project, it would only build if the SDK is a JDK.