Error building jar for kotlin in IntelliJ for desktop

83 Views Asked by At

I'm trying to build an executable jar file for the a demo desktop project with IntelliJ IDEA 2023.3.4 (Community Edition). The kotlin project is the "hello word" that intelliJ creates by default. When I follow all the steps to build the jar file , I receive this error:

Kotlin: The provided plugin androidx.compose.compiler.plugins.kotlin.ComposePluginRegistrar is not compatible with this version of compiler. I'm using the following versions for Kotlin Compiler and compose compiler:

plugins { kotlin("jvm").version("1.9.22") id("org.jetbrains.compose").version("1.5.12") }

I've tried to force the compose compiler 1.5.8 that is the compatible with 1.5.12 compose , but it doesn't work:

compose { kotlinCompilerPlugin.set("1.5.8") }

I've installed the Compose Multiplatform IDE support Plugin 1.5.12 Target JVM is 1.8. Gradle JVM is JDK-21 version 21.0.2

I'd like to know how to proceed to succesfully compile my jar file.

1

There are 1 best solutions below

0
Juan Jaime On

I've finally succeded by using Compose Multiplatform Gradle plugin to build an installation package (.msi) for windows instead build an artifact. In intellij the gradle command I've used to build the msi file is: ./gradlew packageDistributionForCurrentOS.