Java Toolchain for Java 18 on Windows failing

I’m currently trying to move a Gradle build from Java 17 (which works) to Java 18 (which fails).

compileJava {
    sourceCompatibility = '18'

java {
    toolchain {
        languageVersion = JavaLanguageVersion.of(18)

When building I get an error stating that no JDK could be provisioned. First I thought this was a problem with as that isn’t really updated anymore. So I switched to, which still fails (error below).

      > Unable to download toolchain matching these requirements: {languageVersion=18, vendor=any, implementation=vendor-specific}
         > Unable to download toolchain. This might indicate that the combination (version, architecture, release/early access, ...) for the requested JDK is not available.
            > Could not read '' as it does not exist.

I tried also different vendors (ADOPTIUM, ORACLE, MICROSOFT, AZUL) all leading to the same error. So either there is something wrong in Gradle resolving the correct JDK (although 17 works) or the metadata for downloading isn’t up to date yet with the newest release (I can see some EA versions in both api locations).

Ofcourse, I could manually download JDK18 from Oracle or Adoptium but that kind of beats the purpose (for me) of having a Toolchain.


It appears as if the toolchain is actually ignoring the vendor when doing a download. It will always try to download the adoptopenjdk version. The URL is always (or alike). When copy/pasting that URL and use there is an actual download being started.

So did I run into a bug in the toolchain? Looking at the bug tracker this should have been fixed with Toolchains for BELLSOFT download AdoptOpenJDK · Issue #17148 · gradle/gradle (, but apparently it isn’t.