How does Gradle determine which JDK to use

Hi Stefan,

Thanks for the reply. That does help. It seems that it would be a best practice (for Java build projects) to set JAVA_HOME to a JDK rather than a JRE, to avoid any potential confusion.

I understand that Gradle is a general-purpose build system that happens to run on the JVM.
However, as with any build system I assume Gradle requires a specific (external) toolchain for the target language (Java, C, C++, etc). This could be the JDK, Andriod SDK, gcc, llvm, etc.

So I was wondering how Gradle found the JDK since it wasn’t specified, which you’ve already answered. (although in looking at the source and inspecting the gradle process(es) it isn’t entirely clear how that is happening).

thanks a lot for your help!!