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)-"]

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.

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

Leave a Reply

Your email address will not be published. Required fields are marked *