* What went wrong:
A problem occurred evaluating root project 'LS2'.
> Could not resolve all dependencies for configuration ':jarClasspath'.
> Failed to calculate the value of task ':compileJava' property 'javaCompiler'.
> No compatible toolchains found for request filter: {languageVersion=15, vendor=matching('Zulu'), implementation=vendor-specific} (auto-detect true, auto-download true)
If I remove the vendor = JvmVendorSpec.matching("Zulu") part it works (and picks that JDK anyway).
Why is Gradle printing a vendor name with gradle -q javaToolchains that can’t be used to match the vendor with JvmVendorSpec.matching(<name>)?
It turns out that java.vendor is “Azul Systems, Inc.” That is what I would expect the output of gradle -q javaToolchains to show, and it does in fact work when I change the build script to have vendor = JvmVendorSpec.matching("Azul")
Thanks, that helps, However, I think it is a bug to list ‘Zulu’ as a ‘vendor’. That is the name of the product, not the vendor. Same with a few of the others. ‘Amazon’ is the vendor, ‘Amazon Corretto’ is the product for example. Though at least in that case picking ‘Amazon’ would get you a match.
Why would Gradle talk about matching the java.vendor system property and not use those values when listing JDKs? It’s purposely created confusion.
It would also help if there were links at Toolchains for JVM projects (gradle.org) to the JavaDocs for JvmVendorSpec so we don’t have to dig so hard to find the known vendors. I even tried searching for JvmVendorSpec where it says “search the docs” at the top left of that page and no additional hits were found.
It’s also a shame that auto-download doesn’t work for Azul or Bellsoft JDKs. I like to use their JDKs that include JavaFX as it is just simpler to have the JavaFX modules included. Particularly since jmod packages are not available as a dependency, so it is a manual process to set up a build environment that can jlink a JRE that includes JavaFX.