我在运行Kotlin模块时在Build Output中得到以下错误:-
Execution failed for task ':Test:compileKotlin'.
> 'compileJava' task (current target is 1.7) and 'compileKotlin' task (current target is 17) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: https://kotl.in/gradle/jvm/toolchain
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --scan to get full insights.
此模块的build.gradle文件包含以下代码:
plugins {
id 'java-library'
id 'org.jetbrains.kotlin.jvm'
}
java {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7
}
请帮助我找到错误及其解决方案。
1条答案
按热度按时间jdgnovmf1#
试着让Java版本17不像1.7这样: