Managed to get IntelliJ to use Oracle JDK instead ...
# intellij
n
Managed to get IntelliJ to use Oracle JDK instead of the OpenJDK (temporarily using Gradle via traditional Gradle DSL) however doing a Gradle refresh results in the following error being displayed:
FAILURE: Build failed with an exception.
* What went wrong:
org/jetbrains/kotlin/kapt/idea/KaptGradleModel : Unsupported major.minor version 52.0
Doing the equivalent Gradle refresh via
./gradlew build
in the terminal works without any issues (using traditional Gradle DSL). Same error occurs when using Gradle Kotlin DSL instead of the traditional one. Appear to have encountered severe IntelliJ regression(s). One other thing, IntelliJ's syntax checker isn't working when making a change to a .kt file (it is always showing a green check mark) 😧.
For some strange reason IntelliJ doesn't use the specified project JDK (Oracle JDK) for Gradle. Instead the IDE uses the OpenJDK. Resolved the build error by changing Gradle JVM to Oracle JDK in Settings > Build, Execution, Deployment > Build Tools > Gradle.
Syntax checker now works, Gradle refreshes properly, Kotlin standard lib shows up as a external library, and can run the program. 😂