javakotlin

Which versions of Kotlin are compatible with which versions of Java?


I know Kotlin requires Java when running Kotlin. For example, I use Kotlin 1.4.0 and I use Java 14. However, I'm not sure about Kotlin and Java version compatibility.

Is there a Kotlin and Java version compatibility table?

I looked through the official document, but I couldn't find the information that I wanted.


Solution

  • Which versions of JVM does Kotlin target?

    Kotlin lets you choose the version of JVM for execution. By default, the Kotlin/JVM compiler produces Java 8 compatible bytecode. If you want to make use of optimizations available in newer versions of Java, you can explicitly specify the target Java version from 9 to 21.

    https://kotlinlang.org/docs/reference/faq.html#which-versions-of-jvm-does-kotlin-target