Why do I need java.net.preferIPv4Stack=true only on some windows 7 systems?

前端 未结 3 1296
伪装坚强ぢ
伪装坚强ぢ 2020-12-31 22:27

I have used Java on Windows 7 (64bit) machines for quite some time and have never had problems with not being able to create a network connection. Now on the systems at the

3条回答
  •  伪装坚强ぢ
    2020-12-31 23:29

    This is just a theory ...

    According to the Java documentation, if IPv6 is available on the operating system, the underlying native socket will be an IPv6 socket.

    If the operating system doesn't have IPv6, or it has properly configured IPv6, that's what you want. But if the operating system has IPv6 that is not working properly, then I imagine that Java will attempt to use IPv6 to make connections and fail.


    However if I use it Java outputs this silly "Picked up: _JAVA_OPTIONS..." to stderr.

    According to this Q&A, there is no way to turn it off: Suppressing the "Picked up _JAVA_OPTIONS" message

    I would suggest setting _JAVA_OPTIONS globally (if you must) and then unsetting it for the environment you launch your IDE from.

提交回复
热议问题