Socket creation problem with Java on Linux


Sometimes a problem occurs while trying to open a socket connection with Java on a Linux system.
Mostly this is a problem with server settings. It happens if you’ve enables IPv4 and IPv6 on the system.

To make shure Java uses only IPv4 every time a connection is created, just put a new entry in your JAVA_OPTS.

export JAVA_OPTS=$JAVA_OPTS;-Djava.net.preferIPv4Stack=true

,

  1. No comments yet.
(will not be published)
*