Reputation: 35904
I have a new MBP (16" 2019). Downloaded a fresh copy of IntelliJ IDEA Ultimate 2020.1.1. Used SDKMan to install Java 11-zulu and latest Gradle, 6.4. Went to File->New-Project and chose Gradle. When it loads, I get a Sync error and gradle won't process in IntelliJ correctly. Everything works fine from the CLI. I tried with importing an existing gradle project, different Java and Gradle versions, all give the same vague error.
idea.log
Caused by: org.gradle.launcher.daemon.client.DaemonConnectionException: The newly created daemon process has a different context than expected. It won't be possible to reconnect to this daemon. Context mismatch: Java home is different.
I've seen other questions about this but none of those solutions are working for me and I've never had this issue before, 10 years of using IDEA on OSX.
Upvotes: 6
Views: 11946
Reputation: 1616
If some one are using macos with Sdkman use this version: sdk install java 8.0.322-librca
for sdk 1.8 or other correlated version from librca, because sdk fom zulu i always had this same problema in intellij idea with java/kotlin and gradlew...
Upvotes: 1
Reputation: 402513
The issue is likely caused by the incorrect Java home path specified for the JDK in IntelliJ IDEA. Make sure it points to the correct location like this:
/Users/rob/.sdkman/candidates/java/14.0.1-zulu/zulu-14.jdk/Contents/Home
On macOS /Contents/Home
part of the path is significant.
Upvotes: 14