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:
- The first is: File → Project Structure → Project → SDK
- The second is: Settings → Build, Execution, Deployment → Gradle → GradleJVM. Details here: https://mchesnavsky.tech/gradle-use-specific-jdk.
If you still have any questions, feel free to ask me in the comments under this article, or write me on firstname.lastname@example.org.