Search code examples
gradlekotlinjvm

Does Kotlin support Java 11?


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?


Solution

  • The bytecode generated by the Kotlin compiler, when the target version is set to either 1.6 or 1.8, is fully compatible with JVM 11.