Intellij IDEA debugging on WSL

Viewed 672

The initial problem is debugging doesn't work when you simply click debug button, everything just kinda hangs and nothing happens. but it says it listens on port 12345.

If you manually click "Attach debugger", which you normally don't have to do, error occurs.

After hours of figuring it out, configuring firewall, going through logs, manually starting java program, configuring remote debugger, I finally ended up in a thing called "Resource Monitor".

And when I run my java code in debug, by just clicking a button in IDEA, it showed me this.

So after seeing that wslhost.exe listens on port 12345 on IPv6, I googled what's the localhost of IPv6 is and tried to run my remote debugger with this configuration.

And it worked, debugger actually connected and worked normally, now the question is, how do I make it work without manually connecting a debugger, is there a way to tell idea to listen on IPv4, or to connect debugger on IPv6?

Setup: Windows 10 19043.1266, WSL 2, IDEA installed in Windows, jdk in WSL, project is located in WSL.

0 Answers
Related