6
votes

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 company I'm working for I need to set "-Djava.net.preferIPv4Stack=true" or it seems the java processes are not able to create a single connection.

The downside is that if I don't set "_JAVA_OPTIONS" I would have to configure tons of services to use this setting. However if I use it Java outputs this silly "Picked up: _JAVA_OPTIONS..." to stderr (Wonder which guy made that silly decision). This however makes my GWT compiles fail in IntelliJ.

What I would like to know ... this is the first time I'm having these problems and I guess they must somehow be related to the setup of the Operating System. What is probably causing these problems (As I mentioned ... I have about 4 other Systems with windows 7 and 64 bit java vms that don't have these problems).

Chris

3
Try disabling IPv6 on all network interfaces and see, what happens.David Jashi
The problem is that it seems to be impossible to disable this for the loopback devive ... and even after disabling IPv6 for all devices I could disable this, the system still hangs ... untill I get a "Connection Reset" after 1-2 minutes.Christofer Dutz
ask your IT department to fix the IPv6 misconfiguration. If IPv6 is enabled on a machine/network, it has to be configured properly, otherwise there will be nasty problemsmschenk74
How can I check if the configuration is faulty? If I can't prove it, they will deny it ;-)Christofer Dutz

3 Answers

5
votes

Ok so we found out the reason.

This problem seemed to have occured on systems containing a special version of remote access software that our company used. This seems to have inserted some modified dlls into Windows network stack (We were told in order to auto-detect network connectivity). It seems this dll had some issues, causing all IPv6 traffic to be blocked. It also caused the affected Machines to have regular Bluescreens. Uninstalling that software got the system Bluescreen free and I no longer need the preferIPv4Stack setting.

2
votes

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.

1
votes

Just my contribution:

Disabling all the ipv6 on the network devices solved it for me.

I hope this helps