How to configure JVM compatibility for compileJava (11) and compileKotlin (1.8) tasks in build.gradle.kts?
Hi! I'm new to Kotlin and Gradle Kotlin DSL. I have a multi-module project, and I want all Java code to compile under Java 11, and Kotlin code to compile under the same version (target JVM 1.8 is deprecated, I want 11). I'm using Kotlin plugin 1.8.x and the Java plugin.
Problem: in my build.gradle.kts I set sourceCompatibility and targetCompatibility for Java, but compileKotlin still uses the old JVM target. How to fix this?
Here is my current file:
```kotlin
plugins {
kotlin("jvm") version "1.8.20"
java
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.withType {
kotlinOptions {
jvmTarget = "11" // or "1.8"? Error!
}
}
```
When c