Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gradle could not determine Java version from '14.0.1'

Tags:

gradle

I have the following error when I try to build on Gradle:

FAILURE: Build failed with an exception.

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

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

* Get more help at https://help.gradle.org

I have Gradle 6.3 installed. The build uses the Gradle wrapper using Gradle 5.1.1. Do i have to downgrade Java?

like image 702
Denu Lemos Avatar asked Apr 24 '20 15:04

Denu Lemos


2 Answers

As per Gradle release notes (Link):

Compatibility Notes

A Java version between 8 and 13 is required to execute Gradle. Java 14 and later versions are not yet supported.

Java 6 and 7 can still be used for compilation and forked test execution. Just like Gradle 5.x, any supported version of Java can be used for compile or test.

I think you need to downgrade your Java version.

like image 88
saurabh1489 Avatar answered Oct 23 '22 09:10

saurabh1489


Is suspicious in not reporting a Gradle version.

Could you add the output of .gradlew -version on your machine? My first guess would be that you have a Linux distribution packaged version of Gradle which is usually a rebuilt version with selected patches and not something that matches the official Gradle releases.

In addition, when looking at the thrift repo gradle wrapper I see they are still using 5.1.1 which was not Java 12 compatible. You need at least Gradle 5.4.

for more info https://github.com/gradle/gradle/issues/10804

like image 34
Fahim Muntashir Avatar answered Oct 23 '22 07:10

Fahim Muntashir