You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While most people are debugging locally, this becomes a problem especially when using Docker - which needs 0.0.0.0 to be bound to allow the host to communicate over the internal docker network.
/** * The address of the debugger server. * If the value is not set, then only the port will be passed in the debugger options. * * @since 7.6 */@Incubating@Optional@InputProperty<String> getHost();
It won't have any value by default, and the absence of the value will lead to the current behavior – no host name passed to JDWP → loopback only on Java 9+, and all interfaces on older versions.
If present, the string will be passed in the JDWP arguments address= part, always followed by :$port (so the host name should not include the port). It will be possible to use the value "*" for host, meaning that the server should bind on all interfaces.
Similarly, support debugging the Gradle build remotely by introducing the property org.gradle.debug.host with the same semantics as the one described above.
Expected Behavior
In JDK 9, the agentlib options for address changed from requiring simply a port number to allowing a full address (host and port) to be specified.
This change caused the following debug string:
to only bind to 127.0.0.1 in JDK 9, compared to JDK 8 which would bind to 0.0.0.0.
The correct format to keep this behavior is
Sources (couldn't find an official source):
https://www.baeldung.com/java-application-remote-debugging#from-java9
https://www.jetbrains.com/help/idea/debug-a-java-application-using-a-dockerfile.html#create-remote-debug-config
While most people are debugging locally, this becomes a problem especially when using Docker - which needs 0.0.0.0 to be bound to allow the host to communicate over the internal docker network.
Current Behavior
Using the
--jvm-debug
parameter sets-agentlib:jdwp=transport=dt_socket,server=y,suspend=y,address=5005
and only the server, suspend, and port can be overriden, instead of the whole address. In addition, port is an Integer, so you can't specify
*:5005
Context
Workaround:
Suggested solution:
Add a new property to https://docs.gradle.org/current/javadoc/org/gradle/process/JavaDebugOptions.html to specify the address.
gradle/subprojects/core/src/main/java/org/gradle/process/internal/JvmOptions.java
Line 153 in 5ec3f67
Alternatively, the address could take priority over the port.
The text was updated successfully, but these errors were encountered: