最近,我将JDK更新为JDK 10,现在我遇到了Kotlin的配置问题,无法运行我的代码。这是因为JDK 10,还是因为其他原因?
我在创建Kotlin项目时从InteliJ获得的提示:
Configure Kotlin
Added /Applications/IntelliJ IDEA CE.app/Contents/plugins/Kotlin/kotlinc/lib/kotlin-stdlib-jdk7.jar to library configuration
Added /Applications/IntelliJ IDEA CE.app/Contents/plugins/Kotlin/kotlinc/lib/kotlin-stdlib-jdk7-sources.jar to library configuration
Added /Applications/IntelliJ IDEA CE.app/Contents/plugins/Kotlin/kotlinc/lib/kotlin-stdlib-jdk8.jar to library configuration
Added /Applications/IntelliJ IDEA CE.app/Contents/plugins/Kotlin/kotlinc/lib/kotlin-stdlib-jdk8-sources.jar to library configuration
发布于 2018-09-29 21:14:31
在撰写本报告时(9月9日)2018年)Kotlin的编译器默认不支持生成JavaJava字节码。
参数-jvm-target 9
(见KT-21959)应该使Kotlin编译器生成版本53的字节码。
因为Java10是bytecode version 54
(参考文献) --我不确定这将如何工作。
不过:
module-info.java
文件,并将其放置在与Kotlin文件相同的源根中。- The Kotlin compiler will correctly limit the accessibility of declarations in non-exported packages in dependent modules.
- Currently, there are no plans to support module definitions in Kotlin.
除此之外,大多数Java 9-11语言特性(var、REPL、streams等)在Kotlin中已经存在一段时间了,所以使用Java 9-11的主要直接好处是使用JVM进行优化,或者使用模块system / jlink (您可以使用它作为上面的解析)。
https://stackoverflow.com/questions/52570944
复制相似问题