今天早上来公司打开点后启动Idea 报错Address already in use: bind。
Internal error. Please refer to http://jb.gg/ide/critical-startup-errors
java.util.concurrent.CompletionException: java.net.BindException: Address already in use: bind
at java.base/java.util.concurrent.CompletableFuture.encodeThrowable(CompletableFuture.java:314)
at java.base/java.util.concurrent.CompletableFuture.completeThrowable(CompletableFuture.java:319)
at java.base/java.util.concurrent.CompletableFuture$AsyncSupply.run(CompletableFuture.java:1702)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.net.BindException: Address already in use: bind
at java.base/sun.nio.ch.Net.bind0(Native Method)
at java.base/sun.nio.ch.Net.bind(Net.java:455)
at java.base/sun.nio.ch.Net.bind(Net.java:447)
根据报错信息,我们打开第一行提供的官方链接 http://jb.gg/ide/critical-startup-errors ,
找到这个对应的错误, 点击进入解决这个问题的地址
标题上说是端口别占用或者防火墙的原因,所以我用上面提供的命令试了下,重启idea成功了
netsh int ipv4 set dynamicport tcp start=49152 num=16383
netsh int ipv4 set dynamicport udp start=49152 num=16383
net stop winnat
net start winnat
C:\Users\Administrator>netsh int ipv4 set dynamicport tcp start=49152 num=16383
确定。
C:\Users\Administrator>netsh int ipv4 set dynamicport udp start=49152 num=16383
确定。
C:\Users\Administrator>net stop winnat
Windows NAT Driver 服务已成功停止。
C:\Users\Administrator>net start winnat
Windows NAT Driver 服务已经启动成功