code: public static String getIPAddr() {
  		try {
  			Enumeration<NetworkInterface> interfaces = NetworkInterface.getNetworkInterfaces();
  			while (interfaces.hasMoreElements()) {
  				NetworkInterface interfaceN = (NetworkInterface) interfaces.nextElement();
  				Enumeration<InetAddress> ienum = interfaceN.getInetAddresses();
  				while (ienum.hasMoreElements()) {
  					InetAddress ipaddr = (InetAddress) ienum.nextElement();
  					if (ipaddr instanceof Inet4Address) {
  						if (ipaddr.getHostAddress().toString().startsWith("127") || ipaddr.getHostAddress().toString().startsWith("192")) {
  							continue;
  						} else {
  							return ipaddr.getHostAddress();
  						}
  					}
  				}
  			}
  		} catch (Exception e) {
  			e.printStackTrace();
  		}
  		return null;
  	}
docs: 获取服务器本机的IP地址
  @author zhangpingan
  @return