How to change expected Java Home in Gradle project

Answered

I'm trying to build a gradle project but I'm getting the following error:

5:20:34 PM: Executing tasks 'clean compile test'...

The newly created daemon process has a different context than expected.
Java home is different.
Expecting: '/Applications/IntelliJ IDEA CE.app/Contents/jdk/Contents/Home' but was: '/Library/Java/JavaVirtualMachines/jdk1.8.0_181.jdk/Contents/Home'.
Please configure the JDK to match the expected one.
Open JDK Settings
5:20:35 PM: Tasks execution finished 'clean compile test'.

My project SDK is set to jdk 1.8 and my gradle jvm is set to use the project jdk so I do not understand why it is trying to use the inbuilt Intellij jdk. I have tried swapping the cradle jvm to jdk 1.8 directly and using JAVA_HOME to no avail. Additionally I have invalidated caches and restarted numerous times.

0

Please sign in to leave a comment.