I am using Gradle `6.8` + Kotlin `1.4.21-2` + Com...
# compose-desktop
s
I am using Gradle
6.8
+ Kotlin
1.4.21-2
+ Compose
0.3.0-build13
+
OpenJDK15
and getting this weird error on compilation. Has anybody seen this error earlier? Haven't seen this issue with regular kotlin projects though.
Copy code
e: java.lang.NoClassDefFoundError: Could not initialize class org.jetbrains.kotlin.com.intellij.pom.java.LanguageLevel
        at org.jetbrains.kotlin.com.intellij.core.CoreLanguageLevelProjectExtension.<init>(CoreLanguageLevelProjectExtension.java:26)
        at org.jetbrains.kotlin.com.intellij.core.JavaCoreProjectEnvironment.<init>(JavaCoreProjectEnvironment.java:42)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreProjectEnvironment.<init>(KotlinCoreProjectEnvironment.kt:26)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$ProjectEnvironment.<init>(KotlinCoreEnvironment.kt:118)
        at org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment$Companion.createForProduction(KotlinCoreEnvironment.kt:420)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.createCoreEnvironment(K2JVMCompiler.kt:226)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:152)
        at org.jetbrains.kotlin.cli.jvm.K2JVMCompiler.doExecute(K2JVMCompiler.kt:52)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:88)
        at org.jetbrains.kotlin.cli.common.CLICompiler.execImpl(CLICompiler.kt:44)
        at org.jetbrains.kotlin.cli.common.CLITool.exec(CLITool.kt:98)
j
Doesn't look familiar. That stack trace doesn't include who is calling the kotlin compiler; presumably that's gradle via the kotlin gradle plugin, unless you are for some reason calling it from your code or IDE. Are you getting this same error when you build from the command line?
s
Yes, same error from cli also
j
Is it possible to share the project via github or something? Or how can I reproduce?
s
Yeah..will create and share a producer..thanks
x
@suresh can you try
gradle clean
?
I have some issues where cleaning helps getting rid of it - does not solve the core problem but...yeh
s
@xetra11 Yeah i always run with clean (eg:
./gradlew clean package
)
I think the issue seems to be gradle daemon.
☠️ 1
Things started working after stoping the gradle daemon (
./gradlew --stop
) or setting
org.gradle.daemon=false
if you run some other gradle command first, in my case (
./gradlew clean dependencyUpdates
) then it's reproducible
☠️ 1
will report it to kotlin youtrack. Seems this is not a compose issue.
👍 1
1