Intellij IDEA cannot 'see' my WSL java installation. I thought firewall rules could be the culprit. (I've previously been using Kaspersky firewall but recently switched to just using windows defender, so it's possible things that should have been set up on installation of WSL or IDEA that never were)
The official jetbrains docs plus this issue on wsl suggest the following powershell command:
New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -InterfaceAlias "vEthernet (WSL)" -Action Allow
Looking at my defender firewall inbound rules, it does appear that there is no rule for WSL or called WSL, so it would make sense that something of WSL is being blocked. However, running this either as an administrator or normal user, gives me this error:
New-NetFirewallRule : The specified interface was not found on the system.
At line:1 char:1
+ New-NetFirewallRule -DisplayName "WSL" -Direction Inbound -Interface ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidArgument: (MSFT_NetFirewallRule:root/standardcimv2/MSFT_NetFirewallRule) [New-NetFirewallRule], CimExceptio
n
+ FullyQualifiedErrorId : HRESULT 0x80070057,New-NetFirewallRule
Googling the first line of this error yields one result that isn't in English, so I have no idea what this means. It's not even clear from the error which argument is problematic. What's the problem with this command on my machine that apparently isn't a problem on anyone else's?