diff --git a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java index 3315de374c3..b68fe08bd1e 100644 --- a/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java +++ b/test/jdk/tools/jpackage/helpers/jdk/jpackage/test/JPackageCommand.java @@ -768,6 +768,11 @@ public final class JPackageCommand extends CommandArguments { } private JPackageCommand adjustArgumentsBeforeExecution() { + if (!isWithToolProvider()) { + // if jpackage is launched as a process then set the jlink.debug system property + // to allow the jlink process to print exception stacktraces on any failure + addArgument("-J-Djlink.debug=true"); + } if (!hasArgument("--runtime-image") && !hasArgument("--app-image") && DEFAULT_RUNTIME_IMAGE != null && !ignoreDefaultRuntime) { addArguments("--runtime-image", DEFAULT_RUNTIME_IMAGE); }