Gradle和Java的版本对应关系
728
2024-04-11
Gradle 是一个构建工具,可以帮助你构建、测试、打包和发布软件。
在使用 Gradle 时,通常需要使用 Java Development Kit (JDK) 来编译、运行和测试你的项目。
Gradle 的版本与 JDK 版本之间没有固定的对应关系。你可以使用 Gradle 与任何版本的 JDK 配合使用,只要 JDK 版本足够新,支持你使用的 Gradle 版本即可。
一般来说,你可以使用最新的 Gradle 版本,这样可以享受到最新的功能和性能改进。但是,如果你的项目有特殊的需求,例如使用了某些只支持特定版本的 JDK 特性,则可能需要使用特定的 Gradle 版本。
Gradle和Java的版本对应关系

| Java version | Support for toolchains | Support for running Gradle |
|---|---|---|
| 8 | N/A | 2.0 to 8.14.* |
| 9 | N/A | 4.3 to 8.14.* |
| 10 | N/A | 4.7 to 8.14.* |
| 11 | N/A | 5.0 to 8.14.* |
| 12 | N/A | 5.4 to 8.14.* |
| 13 | N/A | 6.0 to 8.14.* |
| 14 | N/A | 6.3 to 8.14.* |
| 15 | 6.7 | 6.7 to 8.14.* |
| 16 | 7.0 | 7.0 to 8.14.* |
| 17 | 7.3 | 7.3 and after |
| 18 | 7.5 | 7.5 and after |
| 19 | 7.6 | 7.6 and after |
| 20 | 8.1 | 8.3 and after |
| 21 | 8.4 | 8.5 and after |
| 22 | 8.7 | 8.8 and after |
| 23 | 8.10 | 8.10 and after |
| 24 | 8.14 | 8.14 and after |
| 25 | 9.1.0 | 9.1.0 and after |
| 26 | N/A | N/A |
参考链接: