It's because the current version of IntelliJ (2021.2.3) is not aware of gradle 7.3. To get around the issue, press "Yes" on the dialog. When the project is created, change distributionUrl in gradle/wrapper/gradle-wrapper.properties to https\://services.gradle.org/distributions/gradle-7.3-bin.zip. After you refresh the project it should be able to build.
I've reproduced the same issue:
Unsupported Project JDK
Cannot find supported Gradle version for JDK 17. The Gradle supports JDK versions 7 through 16.
using Java 17 & Gradle 7.3 & Windows 10.
But, as I see from matrix of compatibility, there must be no issue with Java 17 & Gradle 7.3:
As temporary workaround it can be solved using Java 15 instead of Java 17 with Gradle 7.3, but for me it looks like a bug related to Intellij IDEA 2021.2.2 (Ultimate Edition | Build #IU-212.5284.40, built on September 14, 2021) + Java 17, so I opened a ticket on YT:
Cannot find supported Gradle version for JDK 17. The Gradle supports JDK versions 7 through 16.
Also I've reproduced the same issue using versions of Gradle:
5.6.4, 6.1, 7.1, 7.3
with Java 17 in Intellij IDEA until I downgraded to Java 15.
To be noticed: this is a bug which is specifically related to Java 17 + Intellij IDEA 2021.2.2 (Ultimate Edition | Build #IU-212.5284.40, built on September 14, 2021) and it's not related to GRADLE_HOME + GRADLE_HOME/bin.
I somehow got Java 17 with Gradle 7.2 working (with IntelliJ IDEA 2021.2.2 Community Edition and Windows 10).
I had Gradle 7.2 installed separately. This is what I configured within IntelliJ:
17Specified location and select the path to Gradle 7.2.You could also try to explicitly set the Java language version within build.gradle:
java {
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}