the build script

java {
    toolchain {

is not download jdk…

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':test'.
> Could not resolve all dependencies for configuration ':testRuntimeClasspath'.
   > Failed to calculate the value of task ':compileTestJava' property 'javaCompiler'.
      > No matching toolchains found for requested specification: {languageVersion=17, vendor=any, implementation=vendor-specific}.
         > No locally installed toolchains match (see and toolchain download repositories have not been configured (see

Auto download is enabled

edu>gradle -q javaToolchains

 + Options
     | Auto-detection:     Disabled
     | Auto-download:      Enabled

 + Eclipse Temurin JDK 11.0.19+7
     | Location:           C:\Users\nagku\.gradle\jdks\eclipse_adoptium-11-amd64-windows\jdk-11.0.19+7
     | Language Version:   11
     | Vendor:             Eclipse Temurin
     | Architecture:       amd64
     | Is JDK:             true
     | Detected by:        Auto-provisioned by Gradle

Since Gradle 8, the auto-provisioning does not work out of the box anymore.
You have to declare where to download toolchains from, for example by applying the foojay plugin as documented at the link given in the error message.

1 Like

Oops… any reason for removing auto download feature… I was thinking it is a good lazy engineering feature… Documentation would need update on the point 4 as it still say it would auto download

Point 4 is perfectly valid.
It will auto-download.
Point 4 is saying “on the configured toolchain download repositories”.
In Gradle 7 there were some hard-coded.
In Gradle 8 you need to configure some, for example using the plugin as documented and also mentioned in my last comment.
Just if you don’t configure any, it does not know where to download from.