java.net.SocketException: Invalid argument: connect

后端 未结 8 2298
闹比i
闹比i 2020-12-01 18:47

My new laptop (Alienware m17x) throws a java.net.SocketException: Invalid argument: connect when I run the following basic code:

Server.java:



        
8条回答
  •  没有蜡笔的小新
    2020-12-01 19:22

    I have figured out a way to make this a permanent change from here.

    What you need to do is add a system variable named JAVA_TOOL_OPTIONS and set this to whatever you want to be passed to java as a commandline argument whenever it starts up, in yours and my case being

    -Djava.net.preferIPv4Stack=true

提交回复
热议问题