我在构建我的项目时收到这个错误:
Unsupported Java.
Your build is currently configured to use Java 19.0.2 and Gradle 7.5.
Possible solution:
- Open Gradle wrapper settings, change `distributionUrl` property to use compatible Gradle version and reload the project
我的gradle-wrapper.properties
文件如下所示:
#Mon Feb 27 20:08:12 IST 2023
distributionBase=GRADLE_USER_HOME
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
distributionPath=wrapper/dists
zipStorePath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
因此,Gradle值已经是7.5。我还需要在这里进行哪些更改?
谢谢。
我想通了。Gradle版本必须更改为7.6才能与Java19.0.2兼容。
就我而言,我将gradle升级到8.1,现在可以工作了
对于Java19,需要将gradle版本设置为7.6及以上。同时检查下面的兼容性矩阵
https://docs.gradle.org/current/userguide/compatibility.html