IDEA啓動報錯-java.net.BindException: Address already in use: bind

啓動IDEA報錯日誌以下:java

Internal error. Please refer to http://jb.gg/ide/critical-startup-errors

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:461)
    at java.base/sun.nio.ch.Net.bind(Net.java:453)
    at java.base/sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:227)
    at io.netty.channel.socket.nio.NioServerSocketChannel.doBind(NioServerSocketChannel.java:132)
    at io.netty.channel.AbstractChannel$AbstractUnsafe.bind(AbstractChannel.java:551)
    at io.netty.channel.DefaultChannelPipeline$HeadContext.bind(DefaultChannelPipeline.java:1345)
    at io.netty.channel.AbstractChannelHandlerContext.invokeBind(AbstractChannelHandlerContext.java:503)
    at io.netty.channel.AbstractChannelHandlerContext.bind(AbstractChannelHandlerContext.java:488)
    at io.netty.channel.DefaultChannelPipeline.bind(DefaultChannelPipeline.java:984)
    at io.netty.channel.AbstractChannel.bind(AbstractChannel.java:247)
    at io.netty.bootstrap.AbstractBootstrap$2.run(AbstractBootstrap.java:355)
    at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163)
    at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:416)
    at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:515)
    at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:918)
    at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
    at java.base/java.lang.Thread.run(Thread.java:834)git

 

 

IDEA官網問題:Critical Internal Error on Startup of IntelliJ IDEA: "Cannot Lock System Folders" github

相似問題:https://github.com/docker/for-win/issues/3171docker

 

問題來源:bootstrap

hypervisior(Windows 10的Hyper-V虛擬機),把端口保留了socket

IDEA須要在端口6942~6991間找到一個可用端口並綁定(bind)tcp

 

 

 

 

 

 

解決方案:ide

enashed commented on Jan 31, 2019  (原連接:https://github.com/docker/for-win/issues/3171#issuecomment-459205576
 
 
 

@veqryn the workaround worked for me, the steps are:oop

  1. Disable hyper-v (which will required a couple of restarts)
    dism.exe /Online /Disable-Feature:Microsoft-Hyper-Vpost

  2. 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=<端口號> numberofports=1

  3. 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.

 

請把端口號改爲6942~6991間的任一個數字

相關文章
相關標籤/搜索