java.net.SocketException: Invalid argument: connect

后端 未结 8 2238
闹比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:17

    I have an Alienware m17x R3 and I found that I had the exact same error with Java, though I encountered it with Minecraft. Installing older Java6u33 fixed the issue but I found that newer updates of Java7 still weren't working even after waiting several months. So I eventually went to the Dell website and downloaded the most recent network drivers for my Alienware laptop (since Alienware is now owned by Dell) and that fixed the problem right away.

    0 讨论(0)
  • 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

    0 讨论(0)
提交回复
热议问题