某天启动idea时,弹窗报出如下错误:
百度查看博客IDEA启动报错-java.net.BindException: Address already in use: bind - 蓝天上的云℡ - 博客园 (cnblogs.com)发现是idea启动时需要在端口6942~6991间找到一个可用端口并绑定(bind),但全部被占用导致的,于是按照社区建议我尝试关闭hype-v并调整端口,操作方法参考如下链接:Unable to bind ports: Docker-for-Windows & Hyper-V excluding but not using important port ranges · Issue #3171 · docker/for-win (github.com)
@veqryn the workaround worked for me, the steps are: Disable hyper-v (which will required a couple of restarts) dism.exe /Online /Disable-Feature:Microsoft-Hyper-V When you finish all the required restarts, reserve the port you want so hyper-v doesn't reserve it back netsh int ipv4 add excludedportrange protocol=tcp startport=50051 numberofports=1 Re-Enable hyper-V (which will require a couple of restart) dism.exe /Online /Enable-Feature:Microsoft-Hyper-V /All when your system is back, you will be able to bind to that port successfully.
但是发现无效,启动仍然报错,重装仍然如此,根据端口检查发现6000-7000的端口并未被占用,后查看另一个关于此问题的文章:Critical Internal Error on Startup of IntelliJ IDEA: "Cannot Lock System Folders" – IDEs Support (IntelliJ Platform) | JetBrains发现,有可能idea绑定端口时绑定到了不允许绑定的虚拟网络适配器上(虚拟机创建的网络适配器太多),尝试全部关闭网络适配器并重新开启后,问题得以解决,操作方法如下:
运行管理员权限的powershell PS C:Windowssystem32> Get-NetAdapter | Disable-NetAdapter -Confirm:$false -PassThru:$true | Enable-NetAdapter



