With the latest 7.0 release of Gradle, both running Gradle and building projects on JDK 16 is fully supported . Gradle itself has been upgraded to use Groovy 3 in Groovy based DSL build scripts to fully support JDK 16.20 Nis 2021
Read moreDoes Gradle work with JDK 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.
Read more