$ cat IPv6Test.java import java.net.InetAddress; import java.net.NetworkInterface; import java.util.Enumeration;
public class IPv6Test { public static void main( String args[] ) throws Exception { Enumeration nics = NetworkInterface.getNetworkInterfaces(); while ( nics.hasMoreElements() ) { NetworkInterface ni = (NetworkInterface)nics.nextElement(); System.out.println(ni); } } } $ gcj IPv6Test.java -C $ java IPv6Test // java-sun-1.5.0.06 name:eth0 (eth0) index: 2 addresses: /fe80:0:0:0:20f:eaff:fed3:1f6d%2; /10.0.2.35; name:lo (lo) index: 1 addresses: /0:0:0:0:0:0:0:1%1; /127.0.0.1; $ gij IPv6Test name: lo (lo) addresses: /127.0.0.1; name: eth0 (eth0) addresses: /10.0.2.35; $ /sbin/ip a l 1: lo: <LOOPBACK,UP> mtu 16436 qdisc noqueue (...) inet 127.0.0.1/8 scope host lo inet6 ::1/128 scope host (...) 2: eth0: <BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast qlen 1000 (...) inet 10.0.2.35/24 brd 10.0.2.255 scope global eth0 inet6 fe80::20f:eaff:fed3:1f6d/64 scope link (...) -- Summary: NetworkInterface.getNetworkInterfaces() doesn't report ipv6 interfaces. Product: gcc Version: 4.1.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: libgcj AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pluto at agmk dot net GCC build triplet: x86_64-linux GCC host triplet: x86_64-linux GCC target triplet: x86_64-linux http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28491