I am trying to use Kotlin V1.2.70, Gradle V4.10.1 and Java 11. When compiling the project using gradle, an error saying "Unknown JVM Target Version: 11. Supported versions: 1.6, 1.8".

Does the Kotlin compiler supports Java 11 (produces code compatible with Java 11 JVM)? If so, how to configure that with gradle?

推荐答案

当目标版本设置为1.6或1.8时,Kotlin编译器生成的字节码与JVM 11完全兼容.

Kotlin相关问答推荐

如何避免使用公共类实现内部接口

Spring Boot 3:为Kotlin中的TestRestTemplate配置读取超时

如何优雅地声明一个StateFlow?

Rabin-Karp字符串匹配的实现(Rolling hash)

Flow.state In() 未从其来源接收新值

如何连接两个 kotlin 流?

正则表达式 FindAll 不打印结果 Kotlin

Kotlin 1.2.21 + SimpleXml 2.3.0 - consume List error (must mark set get method)

来自类型参数的属性的自定义 getter

为什么我在使用 Jetpack Compose clickable-Modifier 时收到后端内部错误:Exception during IR lowering error?

如何使用 Kotlin Coroutines 使 setOnClickListener debounce 1 秒?

在java代码中使用kotlin库

Kotlin 扩展函数 - 覆盖现有方法

如何暂停kotlin coroutine直到收到通知

Kotlin的BiMap/2-way hashmap

如何在Kotlin中获得KType?

android Room 将 Null 作为非 Null 类型返回

保存对象时未填充 Spring Boot JPA@CreatedDate @LastModifiedDate

Kotlin中的嵌套let块

函数引用和lambdas