IDEA启动无反应(端口被占用)

问题定位

查看idea的log,默认的log目录:

%localappdata%\JetBrains\${IntelliJIdea+版本}\log

查看idea.log找到启动失败的描述,我碰到的问题是idea报端口被占用。

原因

idea的官网也有人问过这个问题:
idea官网问题描述

原因描述如下:

To lock the folders IDE is starting a server on localhost, it tries to bind on the first available port between 6942 and 6991, this exception is thrown if IDE was not able to bind on any of the ports in this range. All 50 ports are unlikely to be already used on a machine, so it appears to be a networking issue or some security software which doesn’t permit the IDE to bind on any port in this range even on the localhost interface.
On Windows “netsh winsock reset” in the Administrator console followed by the reboot should help. Also try disabling the antivirus/firewall and verify that the network configuration is correct.

有兴趣的浏览一下问题,其主要原因是:IDEA启动时会绑定6942-6991范围内第一个可用的端口,而这些端口被占用。一般情况下这50个端口同时被占用的可能性比较低,大概率是被软件预留了,比如Hyper-V或者docker。

此时使用指令查看一下保留端口即可:

 netsh interface ipv4 show excludedportrange protocol=tcp

解决方法

没有找到idea怎么修改bind端口,那就只能修改hyper-v的保留端口了,修改方法参考docker问题描述中enashed提供的方法:

解决方法
把其中的50051端口号改成6942~6991间的任一个数字,这样就预留出idea使用的端口了。

  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值