异常信息
使用Gradle来打包kotlin项目的时候, 换个电脑就报异常。 异常信息如下:
No matching variant of org.springframework.boot:spring-boot-gradle-plugin:3.0.1 was found. The consumer was configured to find a runtime of a library compatible with Java 11, packaged as a jar, and its dependencies declared externally, as well as attribute 'org.gradle.plugin.api-version' with value '7.6' but:
- Variant 'apiElements' capability org.springframework.boot:spring-boot-gradle-plugin:3.0.1 declares a library, packaged as a jar, and its dependencies declared externally:
- Incompatible because this component declares an API of a component compatible with Java 17 and the consumer needed a runtime of a component compatible with Java 11
- Other compatible attribute:
- Doesn't say anything about org.gradle.plugin.api-version (required '7.6')
- Doesn't say anything about its target Java version (required compa

使用Gradle打包Kotlin项目时换电脑报错,分析可能是spring-boot-gradle-plugin插件不匹配、JDK版本问题、Gradle版本问题,但更换版本均无法解决。最终发现是Gradle使用了版本不正确的JDK的API,需配置IDEA中Gradle使用的JDK。

6172

被折叠的 条评论
为什么被折叠?



