6

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

Christofer Dutz
  • 2,305
  • 1
  • 23
  • 34
  • Try disabling IPv6 on all network interfaces and see, what happens. – David Jashi Jul 15 '13 at 07:05
  • 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 Jul 15 '13 at 07:21
  • 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 problems – mschenk74 Jul 15 '13 at 08:31
  • How can I check if the configuration is faulty? If I can't prove it, they will deny it ;-) – Christofer Dutz Jul 15 '13 at 14:06

3 Answers3

5

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.

Christofer Dutz
  • 2,305
  • 1
  • 23
  • 34
2

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.

Community
  • 1
  • 1
Stephen C
  • 698,415
  • 94
  • 811
  • 1,216
  • Actually setting _JAVA_OPTIONS globally and unsetting it when starting IntelliJ is what I'm doing right now. Unfortunately I have to add the stupid perferIPv4Stack stuff everywhere but can't for the DB integration, so if I want to update this I have to start IntelliJ without unsetting the variable. After the update is done I shutdown IntelliJ and start it with un-set property. But I only need to do this on machines at work and have never had to do this anywhere else so that was why I'm curios at what might be the reason. – Christofer Dutz Jul 15 '13 at 14:02
  • @chrisdutz - Try asking your local system / network administrators at work why IPv6 is enabled but not working. – Stephen C Jul 15 '13 at 14:19
  • Is there a way to test the IPv6 setup? Some tool I could use to proove it's setup wrong? And it doesn't explain why I didn't need it on my laptop at first, but after the IT support "solved" aproblem I had with installing a new OS Image I am having these problems (Together with tons of BSODs) – Christofer Dutz Sep 10 '13 at 13:57
  • Well i did a "ping -6" to another machine and this seems to work nicely. So there should not be something fundamentally flawed. Strange thing is also that I get connection refused when connecting to services running on the local machine. – Christofer Dutz Sep 10 '13 at 14:04
1

Just my contribution:

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

I hope this helps

Eldad Assis
  • 10,464
  • 11
  • 52
  • 78