--- a/gradle.rst Mon Jan 09 22:25:51 2023 +0200
+++ b/gradle.rst Tue Jan 10 00:05:14 2023 +0200
@@ -204,10 +204,33 @@
Listing available toolchains
============================
-::
+Toolchains are introduced in Gradle 6.7.
+
+Requiring a toolchain for the build::
+
+ java {
+ toolchain {
+ languageVersion.set(JavaLanguageVersion.of(11))
+ }
+ }
+
+Altering toolchain for a specific task (derived from ``java`` plugin)::
+
+ tasks.register<Test>("compatibilityTest") {
+ javaLauncher.set(javaToolchains.launcherFor {
+ languageVersion.set(JavaLanguageVersion.of(17))
+ })
+ }
+
+List of available toolchains::
gradle -q javaToolchains
+https://maven.apache.org/guides/mini/guide-using-toolchains.html
+ Guide to Using Toolchains.
+https://blog.gradle.org/java-toolchains
+ Introducing Java toolchains.
+
Running completely isolated build
=================================