diff --git a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt index 6653d9e1f0..ae3b88c40f 100644 --- a/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt +++ b/gradle-plugins/compose/src/main/kotlin/org/jetbrains/compose/desktop/application/tasks/AbstractJPackageTask.kt @@ -321,7 +321,8 @@ abstract class AbstractJPackageTask @Inject constructor( val mappedJar = libsMapping[launcherMainJar.ioFile]?.singleOrNull() ?: error("Main jar was not processed correctly: ${launcherMainJar.ioFile}") - cliArg("--main-jar", mappedJar) + val mainJarRelative = (if (currentTarget.os == OS.Windows) "\\" else "/") + mappedJar.relativeTo(libsDir.ioFile).toString() + cliArg("--main-jar", mainJarRelative) cliArg("--main-class", launcherMainClass) if (currentOS == OS.Windows) {