IPv6 usage is slowly starting nowadays, so I'm currently in the process of fixing and updating all applications to be prepared for IPv6.

One of the applications is the Java editor JOSM (<http://josm.openstreetmap.de/>). Java does not really use IPv6 in the default configuration even if the OS uses IPv6.

According to
<http://docs.oracle.com/javase/1.5.0/docs/guide/net/ipv6_guide/#using>
I set `java.net.preferIPv6Addresses` to `true` to let it use IPv6. Result have been user bug reports about broken internet connection.

It seems Java only switches to use IPv6 address instead of IPv4, but does nothing else. All C/C++ based software I maintain has been changed to check and try all available IP addresses, so broken IPv6 (or IPv4) addresses are skipped as long as one of the addresses works. For me it looks like Java only tries once, which does not work in real world.

Also usually the OS prefers IPv4 over IPv6, when IPv6 is tunneled. It seems like Java does ignore this settings as well.

So my question is: Are there any good ways to get a Java application to use IPV6 by default when available without breaking the application for IPv4 users.

User-bug reports: <http://josm.openstreetmap.de/ticket/8562>, <http://josm.openstreetmap.de/ticket/8627>.