not honored using gradle -v

I have set to my jdk8 in my file in my home dir. And that works fine. But when using “gradle -v” it claims the JVM is still 1.7 which is the one JAVA_HOME points to.

I know I am actually compiling using Java 8, as my code won’t compile using Java 7…

Shouldn’t “gradle -v” show the jdk it actually uses?

I am using Windows 7 64bit, Git Bash 2.4.6 and gradle 2.5

The JRE being reported by gradle -v in this case isn’t strictly incorrect. It is the JAVA_HOME location being used to bootstrap the Gradle CLI. This happens before Gradle reads your properties files, environment variables, command-line arguments, etc to determine which JRE should be used to actually execute the build. This however requires evaluating your project and all it’s build scripts, init scripts, etc. This process is effectively short-circuited when running commands like gradle -v or gradle -?.

Got it. And that’s perfectly fine now that I understand the reason for it. However, how can I, at the start of a particular build, display info on which jdk is used, and what the source and target settings are?

You should be able to get all that from running with the --info command line option.