DEV Community

Pacharapol Withayasakpunt
Pacharapol Withayasakpunt

Posted on

Kotlin based on which JVM? vs just Java?

First of all, I don't meant to code for Android native (yet).

Secondly, I find this on JetBrains,

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 6 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 8 to 13. Note that in this case the resulting bytecode might not run on lower versions.

I also have experience converting whole segments of Java code into Kotlin, when I have to.

I also realized to newer Java might have less verbose features, as well as optimizations.

Also, even for Java 11 or 14, there are variants other than Oracle Java as well... (e.g. adoptopenjdk, GraalVM)

If I had to use Java, I would have to learn a lot more of Java as well, but tutorials would be much easier to find... (Again, I don't normally want tutorials targeting Android.)

I am also looking for Java scripting. Maybe I still have to stick to Kotlin?

Top comments (0)