Unable to setup remote Java debugging on macOS: connection refused
This is not an IDEA problem, but I'm hoping that someone else has enountered the problem and found a solution.
I am trying to setup remote Java debugging between two machines running macOS.
I am able to get the Java program to listen on a socket. However, I can connect to that socket only from the same machine, not from another machine on my local network. I use nc to test the connection. It reports Connection refused when trying to connect from the other machine.
This issue sounds like it could be caused by the Java program lacking Local Network system permission. I am familiar with that issue arising when a program attempts to connect to a port on the local network. In that case, a dialog is displayed and System Settings can be used to grant Local Network permission to the client program. I don't know whether the same permission is required on the program that is *receiving* client requests. If it is, then I don't know how to grant that permission. There is no dialog, and System Settings does not provide any obvious way to grant permission to a program that I specify.
I am running macOS 15.6 and 26.
Please sign in to leave a comment.
I forgot to mention that the firewall is not turned on.
https://www.wireshark.org/#download
I ran Wireshark but I have no idea what the output means.
If I specify an IP address, nc still fails but only once.
```
nc: connectx to 192.168.0.31 port 5005 (tcp) failed: Connection refused
```
The firewall is not enabled.
It turned out to be my mistake, caused by using an old script.
The command line argument needs to contain `address=*:5005`, not `address=5005`.