英文:
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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论