Kotlin could not initialize class LanguageLevel

If you facing this error:

java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.com.intellij.pom.java.LanguageLevel
Caused by: java.lang.ExceptionInInitializerError: Exception java.lang.ExceptionInInitializerError [in thread "RMI TCP Connection(2)- 127.0.0.1"]

Double check, that you are using correct version of JDK while building your app. You may have:

sourceCompatibility = JavaVersion.VERSION_1_9
jvmTarget = JavaVersion.VERSION_1_9

but actually use JDK 19. This will cause the errors, described above.

Remember, that there are two places to check in IntelliJ IDEA:

That’s all.


Telegram channel

If you still have any questions, feel free to ask me in the comments under this article or write me at promark33@gmail.com.

If I saved your day, you can support me 🤝