Wrong JDK version returned by compileJava toolChain (continued from old forum)

Continuing the discussion from Wrong JDK version returned by compileJava toolChain:

Here’s my gradle -version output:

Gradle 2.2.1

Build time: 2014-11-24 09:45:35 UTC
Build number: none
Revision: 6fcb59c06f43a4e6b1bcb401f7686a8601a1fb4a

Groovy: 2.3.6
Ant: Apache Ant™ version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_40 (Oracle Corporation 25.40-b25)
OS: Windows 7 6.1 amd64

I understand that toolChain is for internal use, so I probably shouldn’t be using it. I think I already moved along to another solution for this build so it’s not an issue at the moment.

But to be clear, I’m not doing cross compilation. I’m just reporting my observation that Gradle says it is running in the JDK when it is running in the JRE. That’s incorrect information and may cause problems down the road like it did for me.

Thanks! That makes sense.

toolChain has been removed for 2.4, so there won’t be something tempting to give you the wrong information. We’re working on being able to resolve different versions of the Java compiler tool chain than the one you run Gradle with (that’s not there yet). As part of the tool resolving step, we’ll only look for JDK installations (so the JDK prefix will make sense then).

1 Like