Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Java remote debugging connection refused

Tags:

java

I get connection refused when remotely debugging a Java application that executes on a different server. The JVM is version 16, and the OS is Ubuntu 21.04. I chose 8999 as an unused port on the server. Not much help from Oracle documentation on runjdwp.

The command line options are ...

-Xdebug \
-Xrunjdwp:transport=dt_socket,address=8999,server=y,suspend=y \
like image 824
Stephen Reed Avatar asked Dec 19 '25 16:12

Stephen Reed


1 Answers

The socket 8999 on the remote host defaults to 127.0.0.1:8999 which only accepts connections from running on the same host. In order to accept connections from any host, I found that the following worked OK.

-Xdebug \
-Xrunjdwp:transport=dt_socket,address=0.0.0.0:8999,server=y,suspend=y \
like image 147
Stephen Reed Avatar answered Dec 21 '25 08:12

Stephen Reed



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!