FAILURE: Build failed with an exception ':compileJava'

Hello,
When I try to export my Forge 1-20.1 Mod from MCreator this error happens:

FAILURE: Build failed with an exception. 
* What went wrong: 
Could not determine the dependencies of task ':compileJava'. 
> Could not resolve all dependencies for configuration ':compileClasspath'. 
   > Failed to calculate the value of task ':compileJava' property 'javaCompiler'. 
      > Cannot find a Java installation on your machine matching this tasks requirements: {languageVersion=17, vendor=any, implementation=vendor-specific} for WINDOWS on x86_64. 
         > No matching toolchain could be found in the locally installed toolchains or the configured toolchain download repositories. Some toolchain resolvers had provisioning failures: foojay (Unable to download toolchain matching the requirements ({languageVersion=17, vendor=any, implementation=vendor-specific}) from 'https://api.foojay.io/disco/v3.0/ids/7ff9b97e0da2e21666aa844b1bee2435/redirect', due to: Could not get resource 'https://api.foojay.io/disco/v3.0/ids/7ff9b97e0da2e21666aa844b1bee2435/redirect'.). 
* Try: 
> Learn more about toolchain auto-detection at https://docs.gradle.org/8.8/userguide/toolchains.html#sec:auto_detection. 
> Learn more about toolchain repositories at https://docs.gradle.org/8.8/userguide/toolchains.html#sub:download_repositories. 
> Run with --stacktrace option to get the stack trace. 
> Run with --info or --debug option to get more log output. 
> Run with --scan to get full insights. 
> Get more help at https://help.gradle.org. 
BUILD FAILED in 23s

I have Java installed, and I can download the file from the link

What can I do about it?

You might have Java installed, but not the one that your build configures it needs for compiling your sources.
Or it is installed in a place Gradle does not look by default.
You can also give the location via environment variables for example as shown in the documentation.

As the link works from your browser but not from Gradle, this most often means you need to use some Proxy to access the outworld which you configured for your Browser, but not for Gradle and thus the download fails. Or sometimes Firewall or AntiVirus are intervening.