Does anyone know why the Kotlin compiler does not work with JDK 20, even with the Maven extension instead of Gradle? 🤔
s
Stephan Schröder
12/11/2022, 9:08 PM
which version of Kotlin and the Maven extension do you use? maybe at least one of those doesn't support JDK 20 yet?
e.g. it looks like before Kotlin 1.7, the kapt had issues with the latest jdks
g
Gavin Ray
12/19/2022, 7:33 PM
@Stephan Schröder If you use raw
kotlinc
compiler, it will say that it doesn't support JDK 20
I dunno if JDK 20 as a target bytecode is important, but I was trying to use some of the experimental/preview features from the 20 EA
s
Stephan Schröder
12/20/2022, 9:31 AM
It's my best guess that this is the issue. But it is only a guess.
It's actually one of the (smaller but still nice) reasons I prefer Kotlin over Java: you can increase the language version without being automatically increasing the bytecode version. I think it was a Spring project I once wanted to upgrade to an non-LTS Java version, but Spring uses ByteBuddy (if I'm not mistaken) and ByteBody didn't add support for the new bytecode version until 3 months in, which is 50% of the lifetime of a non-LTS Java version 😒