Gradle 7.0 released with JDK 16 support

Gradle 7.0 Released with Support for JDK 16

Gradle, the customizable open source build automation tool, has been released in version 7.0. This release includes JDK 16 support, faster incremental builds, improved build reliability with validation errors, and native support for new Macs with Apple Silicon processors. In addition, preview features introduced in earlier releases, such as JVM toolchains, dependency locking, dependency validation, and support for the Java module system, have been upgraded to stable features in version 7.0.

Previous Gradle versions do not run on the latest JDK 16. However, with the help of the JVM toolchain, people can still build their Java projects using JDK 16 by disabling incremental compilation. In the latest Gradle 7.0 release, 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. Groovy 3 includes new features and functionality, as well as interoperability with newer Java features. Note that Groovy 2 and Groovy 3 are not fully compatible, so you may have problems upgrading to Gradle 7.0. Please refer to Gradle upgrade instructions for further guidance.

Each release of Gradle continues to bring speed improvements to incremental builds. This version enables optimized file system viewing by default on all supported platforms, such as Windows, Linux, and MacOS. This optimization helps Gradle understand changes to build input and output files and keeps this information in memory between builds. This allows Gradle to skip reading information from the file system on each build, reducing the amount of disk I/O required to determine input and output file changes between builds.

Another build speed increase is achieved in this release by ignoring the empty **buildSrc folder. Prior to this release, the existence of the buildSrc folder forced Gradle to perform all related tasks, possibly resulting in build cache loss and additional performance overhead. Gradle now ignores the empty buildSrc** folder to skip unnecessary tasks and avoid cache loss.

One stable feature that stands out from Gradle 7.0 is full support for the Java module system. Users can now build, test, and run Java modules using Gradle. The mere presence of module-info.java allows Gradle to infer that your JAR is a module and must be placed on the module path, not the traditional classpath.

Plugin development improvements such as support for plug-ins with multiple variants, included builds for native plug-ins, fixes to security bulletins, improvements to dependency locking, experimental version directories, and type-safe project accessors are some of the other notable improvements and features in Gradle 7.0.