From 56fb8828cfbfeeb0c7adc055c5685ebb4ee7e359 Mon Sep 17 00:00:00 2001 From: Foivos Zakkak Date: Wed, 29 Sep 2021 15:22:26 +0300 Subject: [PATCH] Fix quarkus.native.debug-build-process As of JDK 9 `address` needs to specify the host as well. This patch makes JDWP listen on 0.0.0.0 and is compatible with JDK 8 and JDK >= 9 --- .../deployment/pkg/steps/NativeImageBuildStep.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java index 5077793e53a04..1494dab5b5457 100644 --- a/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java +++ b/core/deployment/src/main/java/io/quarkus/deployment/pkg/steps/NativeImageBuildStep.java @@ -620,8 +620,15 @@ public NativeImageInvokerInfo build() { nativeImageArgs.add("-H:DebugInfoSourceSearchPath=" + APP_SOURCES); } if (nativeConfig.debugBuildProcess) { + String debugBuildProcessHost; + if (isContainerBuild) { + debugBuildProcessHost = "0.0.0.0"; + } else { + debugBuildProcessHost = "localhost"; + } nativeImageArgs - .add("-J-Xrunjdwp:transport=dt_socket,address=" + DEBUG_BUILD_PROCESS_PORT + ",server=y,suspend=y"); + .add("-J-Xrunjdwp:transport=dt_socket,address=" + debugBuildProcessHost + ":" + + DEBUG_BUILD_PROCESS_PORT + ",server=y,suspend=y"); } if (nativeConfig.enableReports) { nativeImageArgs.add("-H:+PrintAnalysisCallTree");