https://kotlinlang.org logo
#realm
Title
# realm
b

benkuly

02/18/2023, 11:58 AM
Does the
id("io.realm.kotlin")
any magic regarding JVM versions? Since upgrading to Kotlin 1.8.0 and gradle 8.0 I get
Copy code
Caused by: org.gradle.api.GradleException: 'compileJava' task (current target is 11) and 'compileKotlinJvm' task (current target is 1.8) jvm target compatibility should be set to the same Java version.
Consider using JVM toolchain: <https://kotl.in/gradle/jvm/toolchain>
You can find the
build.gradle.kts
file here. It uses JVM toolchain, which works in all the other modules of this project.
I fixed it by setting
Copy code
tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile>().configureEach {
    kotlinOptions {
        jvmTarget = Versions.kotlinJvmTarget.majorVersion
    }
}
But this wasn't required before.
correction: runs locally, but not in the CI.
Removing
withJava()
seems to have fixed the issue.
65 Views