Kotlin no longer compiled with JVM 1.8 target


#1

It seems Kotlin is now compiled on codingame with JVM 1.6 target instead of JVM 1.8, probably since the last Kotlin 1.3 update.

Code that was working last summer using java 8 features (Comparator.comparingInt(…)) no longer compiles on codingame, and the error message indicates that a JVM 1.6 target is used :

error: calls to static methods in Java interfaces are prohibited in JVM target 1.6. Recompile with ‘-jvm-target 1.8’.


#2

Hi @kgautron,

Ok we’ll try. Do you know if this kotlinc jvm-target option (and potentially others) is documented somewhere?

Thanks.


#3

Hi @_CG_XorMode,

I could not find any kotlinc documentation either (I usually let my IDE compile for me).

But by looking at the following classes from kotlin git repo, i would guess that the option to pass is : ‘jvmTarget’, and the value to use (for JDK 8) : ‘1.8’.

*https://github.com/JetBrains/kotlin/blob/master/compiler/cli/src/org/jetbrains/kotlin/cli/jvm/jvmArguments.kt
*https://github.com/JetBrains/kotlin/blob/master/compiler/frontend.java/src/org/jetbrains/kotlin/config/JvmTarget.kt

Also there must be someone in the team who has already done it, because i remember a post on the forum about going from jvm 1.5 to jvm 1.8 for kotlin.

Good luck :wink:


#4

Fixed! See https://www.codingame.com/forum/t/languages-update/1574/98