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

I used Java on computers with Windows 7 (64 bit) for quite some time and never had problems with the inability to create a network connection. Now about the systems in the company I work for, I need to set "-Djava.net.preferIPv4Stack = true" or, it seems, java processes cannot create one connection.

The downside is that if I did not set "_JAVA_OPTIONS", I would have to configure tons of services to use this setting. However, if I use it, Java displays this stupid "Picked up: _JAVA_OPTIONS ..." on stderr (I wonder which guy made this stupid decision). This, however, makes my GWT compilations unsuccessful in IntelliJ.

What I would like to know ... this is the first time I am having these problems, and I think they should somehow be related to setting up the operating system. Which probably causes these problems (As I said ... I have about 4 other systems with windows 7 and 64 bit java vms that do not have these problems).

Chris

+5
java windows-7 networking
source share
3 answers

So, we found out the reason.

This problem, apparently, arose in systems containing a special version of the remote access software used by our company. It looks like they added some changed DLLs to the stack stack of Windows (we were told to automatically detect a network connection). This dll seems to have had some problems, which is why all IPv6 traffic was blocked. This also caused the affected Machines to have regular Bluescreens. Removing this software freed up the Bluescreen system, and I no longer need to configure preferIPv4Stack.

+4
source share

This is just a theory ...

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

If the operating system does not have IPv6 or has properly configured IPv6, this is what you want. But if IPv6 is not working properly on the operating system, I believe Java will try to use IPv6 for connection and failure.


However, if I use it, Java displays this stupid "Picked up: _JAVA_OPTIONS ..." on stderr.

According to this Q & A, there is no way to disable it: Suppress "Picked up _JAVA_OPTIONS" message

I would suggest setting _JAVA_OPTIONS globally (if necessary) and then disable it for the environment from which you are launching your IDE.

+2
source share

Only my contribution:

Disabling all ipv6 on network devices solved this for me.

I hope this helps

0
source share

All Articles