Closed Xiaolangs closed 1 year ago
Could you please check which JDK version you're using for your project? PreCompose requires at least JDK 11.
I have the same problem too and still i can't fix it. how can i check JDK version in project? Also when I download and open the PreCompose project from github, I have this problem.
I have the same problem too and still i can't fix it. how can i check JDK version in project? Also when I download and open the PreCompose project from github, I have this problem.
Can you check which JDK version you're using by java --version
?
I have the same problem too and still i can't fix it. how can i check JDK version in project? Also when I download and open the PreCompose project from github, I have this problem.
Can you check which JDK version you're using by
java --version
?
java 11.0.19 2023-04-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.19+9-LTS-224) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.19+9-LTS-224, mixed mode)
I have the same problem too and still i can't fix it. how can i check JDK version in project? Also when I download and open the PreCompose project from github, I have this problem.
Can you check which JDK version you're using by
java --version
?java 11.0.19 2023-04-18 LTS Java(TM) SE Runtime Environment 18.9 (build 11.0.19+9-LTS-224) Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.19+9-LTS-224, mixed mode)
Can you check your Intellij project SDK by opening Project Structure -> Project Settings -> Project? And BTW, Android Gradle plugin requires Java 17 to run after version 8.0, you should using JDK 17 now.
Close as inactive, reopen if you still have the same issue.
Temporary solution:
@file:Suppress("INLINE_FROM_HIGHER_PLATFORM")
viewModel //tip Cannot inline bytecode built with JVM target 11 into bytecode that is being built with JVM target 1.8. Please specify proper '-jvm-target' option
//code import org.jetbrains.compose.desktop.application.dsl.TargetFormat import org.jetbrains.kotlin.config.JvmTarget import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
plugins { kotlin("jvm") id("org.jetbrains.kotlin.plugin.serialization") version "1.9.10" id("org.jetbrains.compose") }
group = "com.xiaolang" version = "1.0-SNAPSHOT"
repositories { mavenCentral() maven("https://maven.pkg.jetbrains.space/public/p/compose/dev") google() }
dependencies { // Note, if you develop a library, you should use compose.desktop.common. // compose.desktop.currentOs should be used in launcher-sourceSet // (in a separate module for demo project and in testMain). // With compose.desktop.common you will also lose @Preview functionality implementation(compose.desktop.currentOs)
} tasks.withType {
kotlinOptions {
jvmTarget = "11"
}
}
compose.desktop { application { mainClass = "MainKt" nativeDistributions { targetFormats(TargetFormat.Dmg, TargetFormat.Msi, TargetFormat.Deb) packageName = "bt" packageVersion = "1.0.0" } }
}