Could not determine java version from '14.0.2'

Viewed 3272

When I try to use ./gradlew I get these errors:

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine java version from '14.0.2'.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

My OS is MacOS Catalina Version 10.15.6,

My Java version is 14.0.2,

My gradle version is 6.6.1,

I installed gradle using brew install gradle,

and my JAVA_HOME variable is /Library/Java/JavaVirtualMachines/adoptopenjdk-14.jdk/Contents/Home

For some reason I cannot figure out the problem, any ideas?

2 Answers

If updating the switch doesn't work, update the value in the following property file:

cat gradle/wrapper/gradle-wrapper.properties

$  cat gradle/wrapper/gradle-wrapper.properties
#Thu May 03 21:00:01 BST 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-all.zip

Then, try again:

$ ./gradlew build
Downloading https://services.gradle.org/distributions/gradle-6.6.1-all.zip
..........................................................................................................................................
Unzipping /Users/marcellodesales/.gradle/wrapper/dists/gradle-6.6.1-all/ejrtlte9hlw8v6ii20a9584rs/gradle-6.6.1-all.zip to /Users/marcellodesales/.gradle/wrapper/dists/gradle-6.6.1-all/ejrtlte9hlw8v6ii20a9584rs
Set executable permissions for: /Users/marcellodesales/.gradle/wrapper/dists/gradle-6.6.1-all/ejrtlte9hlw8v6ii20a9584rs/gradle-6.6.1/bin/gradle

Welcome to Gradle 6.6.1!

Here are the highlights of this release:
 - Experimental build configuration caching
 - Built-in conventions for handling credentials
 - Java compilation supports --release flag

For more details see https://docs.gradle.org/6.6.1/release-notes.html

Made sure Java version was 14.0.2...

$ java -version
java version "14.0.2" 2020-07-14
Java(TM) SE Runtime Environment (build 14.0.2+12-46)
Java HotSpot(TM) 64-Bit Server VM (build 14.0.2+12-46, mixed mode, sharing)
Related