#java#get server ip
InetAddress.getLocalHost().getCanonicalHostName()
or
System.getenv("userdomain")
private static void showIP() throws Exception {
Enumeration<NetworkInterface> e = NetworkInterface.getNetworkInterfaces();
while (e.hasMoreElements()) {
NetworkInterface n = (NetworkInterface) e.nextElement();
Enumeration<InetAddress> ee = n.getInetAddresses();
while (ee.hasMoreElements()) {
InetAddress i = (InetAddress) ee.nextElement();
if(i.isLoopbackAddress()) continue;
if(i.isLinkLocalAddress()) continue;
if(!i.isSiteLocalAddress()) continue;
System.out.println(i.getHostAddress());
}
}
}