Targeting JVM 1.8 on Kotlin with Gradle is as easy as
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
But that doesn't work for Java 9 if I simply change the jvmTarget to 9 or 1.9. How can I do it?
Targeting JVM 1.8 on Kotlin with Gradle is as easy as
compileKotlin {
kotlinOptions {
jvmTarget = "1.8"
}
}
But that doesn't work for Java 9 if I simply change the jvmTarget to 9 or 1.9. How can I do it?
See the Kotlin "Using Gradle" reference "Attributes specific for the JVM" for possible values of the attribute jvmTarget:
Name:
jvmTargetDescription: Target version of the generated JVM bytecode (1.6, 1.8, 9, 10, 11 or 12), default is 1.6
Possible values: "1.6", "1.8", "9", "10", "11", "12"
Default value: "1.6"
Copied 2019/10/01