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

huangapple go评论68阅读模式
英文:

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

问题

我知道在运行Kotlin时需要Java。例如,我使用Kotlin 1.4.0并且使用Java 14。然而,我不确定Kotlin和Java版本的兼容性。

是否有Kotlin和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.

答案1

得分: 10

Kotlin针对哪些版本的JVM?

Kotlin允许您选择执行的JVM版本。默认情况下,Kotlin/JVM编译器会生成与Java 8兼容的字节码。如果您想利用较新版本Java中可用的优化功能,您可以明确指定目标Java版本为9到18。

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

英文:

> 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 18

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

huangapple
  • 本文由 发表于 2020年9月21日 17:42:01
  • 转载请务必保留本文链接:https://go.coder-hub.com/63989767.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定