From 8d78c4ac67b3e6e6492e7068291727b9e6bba8ae Mon Sep 17 00:00:00 2001 From: mcpiroman Date: Tue, 22 Mar 2022 22:22:58 +0100 Subject: [PATCH] Provide relative path to jpackage --main-jar --- .../compose/desktop/application/tasks/AbstractJPackageTask.kt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {