Hi! In my `build.gradle.kts` I am having ``` val ...
# announcements
k
Hi! In my
build.gradle.kts
I am having
Copy code
val javaVersion = JavaVersion.VERSION_1_8

plugins {
  kotlin("jvm")
}

java {
  sourceCompatibility = javaVersion
  targetCompatibility = javaVersion
}
Yet, I am seeing an error saying: please, recompile to 1.8, when I use static methods in interfaces. I have added the following to make it work:
Copy code
tasks.withType<KotlinCompile> {
  kotlinOptions.jvmTarget = javaVersion.toString()
}
Is there a better way?