2
  • Complementary to this question: tell-gradle-to-use-specific-java-version
  • How can I determine (verify) the java version actually used in gradle build?
  • After a successful ./gradlew build, I looked for javac, but it was just in a binary file:
$ grep -rn "javac"
Binary file .gradle/4.6/taskHistory/taskHistory.bin matches
  • I have many java versions installed, so a mixup is possible.
  • Is there any way to verify the java version?
OrenIshShalom
  • 4,294
  • 5
  • 22
  • 55

2 Answers2

1

./gradlew --version will tell you which jdk version you are using.

Kaj Hejer
  • 763
  • 3
  • 12
  • 2
    This gives the JRE version that gradle is running under. It could be different from the javac version it will use to compile java files. – k314159 Mar 29 '21 at 12:53
1

If you add --info to the build command it will tell you what java exe it is using for the compile:

./gradlew build --info

Then look for the string Starting process and you will see a line like:

Starting process 'Gradle Worker Daemon 10'. Working directory: C:\dev\.gradle\workers Command: C:\dev\.jdks\corretto-11.0.13\bin\java.exe ...'
Joman68
  • 1,579
  • 3
  • 27
  • 28