idea启动报错“Address already in use: bind”

今天下午启动idea,突然来了个端口被占用的错误,记录下解决方法。
报错信息如下:

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)
    at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
    at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:134)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:550)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1334)
    at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:506)
    at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:491)
    at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:973)
    at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:248)
    at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:356)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:164)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:472)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:500)
    at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:989)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
    ... 1 more
JRE 11.0.6+8-b765.25 amd64 by JetBrains s.r.o
D:\Program Files\JetBrains\IntelliJ IDEA 2020.1\jbr

根据错误信息,打开官方指南(http://jb.gg/ide/critical-startup-errors),试着去寻找解决方式,点开网站如下部分:
idea启动报错“Address already in use: bind”_第1张图片
点开IDEA-238995链接,打开的网页中找到如下部分:
idea启动报错“Address already in use: bind”_第2张图片因为我使用端口查找命令没找到6942到6991之间的正在使用的端口,所以抱着试试的态度按照官方问题解决思路执行了一下,真的搞定了。
用管理员身份打开cmd命令行,执行如下命令:

Microsoft Windows [版本 10.0.19044.2130]
(c) Microsoft Corporation。保留所有权利。

C:\WINDOWS\system32>netsh int ipv4 set dynamicport tcp start=49152 num=16383
确定。


C:\WINDOWS\system32>netsh int ipv4 set dynamicport udp start=49152 num=16383
确定。


C:\WINDOWS\system32>net stop winnat

Windows NAT Driver 服务已成功停止。


C:\WINDOWS\system32>net start winnat

Windows NAT Driver 服务已经启动成功。


C:\WINDOWS\system32>

然后再重启idea,正常启动。

你可能感兴趣的:(开发工具,intellij-idea,port,bind)