The fix for #95 in 1.6.13 actually broke the compilation in my case. Here is what I typically do:
java {
toolchain {
languageVersion = JavaLanguageVersion.of(22)
}
}
withType<JavaCompile>().configureEach {
options.release = 8
}
This configuration uses the latest toolchain to compile for a specific Java version. However, as of the changes in 1.6.13, this is no longer supported. The culprit seems to be that the compatibility versions are set to the toolchain versions regardless of whether options.release is specified and then take precedence.
For example, this issue surfaces when writing a plugin in Kotlin:
kotlin {
compilerOptions {
jvmTarget = JvmTarget.JVM_1_8
}
}
Running a build then fails even if options.release is set with:
Inconsistent JVM-target compatibility detected for tasks 'compileJava' (22) and 'compileKotlin' (1.8).