Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Starting from which version Gradle supports Java 17

When trying to configure the project I'm getting the error:

Unsupported Java. Your build is currently configured to use Java 17.0.1 and Gradle 7.0.

Unfortunately there are no information in official documentation for now.

like image 246
Nolequen Avatar asked Nov 01 '21 18:11

Nolequen


People also ask

Does Gradle support Java 17 & Gradle 7?

Cannot find supported Gradle version for JDK 17. The Gradle supports JDK versions 7 through 16. using Java 17 & Gradle 7.3 & Windows 10. But, as I see from matrix of compatibility, there must be no issue with Java 17 & Gradle 7.3:

How to change Gradle language version?

java { toolchain { languageVersion = JavaLanguageVersion.of (17) } } Assuming that you're looking to switch versions of gradle, the best way forward is to use a version manager. I personally use sdkman which is Open source and provides support for major tools like Java, Maven, Gradle and others.

What version of Gradle do you use in your IDE?

I personally use sdkman which is Open source and provides support for major tools like Java, Maven, Gradle and others. The benefit is you can install multiple versions and switch between them without dealing with env vars. The 2021.2 IDE version uses 7.2 Gradle version for new projects.

What's new in this release of Gradle for Mac?

This release adds new events that notify the IDE as files are downloaded. This allows IDEs to show better progress information while Gradle is running and during IDE import/sync. Both ant and common-compress bundled libraries have been updated to resolve reported vulnerabilities.


2 Answers

Gradle 7.3 is the first version fully supporting Java 17. From the Release Notes:

Support for Java 17

Gradle now supports running on and building with Java 17.

In previous Gradle versions, running Gradle itself on Java 17 resulted in an error. JVM projects could have been built with Java 17 using toolchains.

As of Gradle 7.3, both running Gradle itself and building JVM projects with Java 17 is fully supported.

like image 100
thokuest Avatar answered Oct 10 '22 10:10

thokuest


From version 7.3 Gradle is officially supporting Java 17. For more details, compatibility matrix can be seen here and details of releases can be seen from here.

like image 27
Deepanshu Bhardwaj Avatar answered Oct 10 '22 09:10

Deepanshu Bhardwaj