We have a project that uses Kotlin and Java together. The build tool is maven. So far there is no problem unless we set the jvmTarget
> 12. As described in the official Kotlin maven docs, the possible values for kotlin.compiler.jvmTarget
are “1.6”, “1.8”, “9”, “10”, “11”, “12” (https://kotlinlang.org/docs/reference/using-maven.html) Is there any way to run the Java part of the application on newer versions of the JDK?
Why is this relevant? Not everything that is implemented in Java can be easily migrated to Kotlin or for some reason we like the Java way in some situations more (at least right now), but I would like to benefit from the new features in JDK > 12.
Hi @pas2al
Is there any way to run the Java part of the application on newer versions of the JDK?
Use a newer JVM, nothing more.
Why is this relevant?
It sets the .class
major.minor version.
You can set jvmTarget = 1.8
and use Kotlin classes on any JDK >= 8 version.