Question

In an app which I have programmed, I have a java.net.SocketException on a specific computer:

java.net.SocketException: Address family not supported by protocol family: connect

This specific computer runs Windows 7 32 Bit and is connected to the internet through Local Area Connection (Ethernet). The app runs correctly on other computers, with Windows 7 and Windows 8, connected through Local Area Connection or through Wi-Fi, so I am actually not sure that the problem is programmatic. I have tried to check the protocols of the Local Area Connection, but I didn't see any problems. Can someone please help me understand what is the problem? Why is this exception thrown?

Was it helpful?

Solution 3

Try to check whether the spy program called "RelevantKnowledge" is installed. Its uninstallation helped me to solve the problem.

OTHER TIPS

For me Java option -Djava.net.preferIPv4Stack=true did the trick

  1. Open command prompt (windows start button, type cmd in search)
  2. Click top left of command prompt, click properties, enable quick edit mode
  3. Copy: setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true

  4. Right click on command prompt, should paste

  5. Hit enter. That easy!

It may be a few things:

  • Anti-virus blocking the connection. If you have an anti-virus running on that computer, try disabling it for a test.
  • Java 7 trying to use IPv6 to connect: if you have Java 6 on the computers where it works and Java 7 where it fails, try disabling IPv6 in Java on the computer where it fails (instructions in this post)

If you are using java 6, try to change to java 7. It works for me.

Thanks this helped me :

Anti-virus blocking the connection. If you have an anti-virus running on that computer, try disabling it for a test.

Open command prompt (windows start button, type cmd in search) Click top left of command prompt, click properties, enable quick edit mode Copy: setx _JAVA_OPTIONS -Djava.net.preferIPv4Stack=true Right click on command prompt, should paste Hit enter. That easy!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top