private static String getIPAddress ( ) { String rc ; try { rc = InetAddress . getLocalHost ( ) . getHostAddress ( ) ; } catch ( Exception e ) { // No FFDC code needed rc = Long . valueOf ( new Random ( ) . nextLong ( ) ) . toString ( ) ; } return rc ; }
InetAddress is compatible with both IPv4 & IPv6