public static String getIpAddress() {
		try {
			for(Enumeration<NetworkInterface> enumNic = NetworkInterface.getNetworkInterfaces();
					enumNic.hasMoreElements();) {
				NetworkInterface ifc = enumNic.nextElement();
				if (ifc.isUp()) {
					for (Enumeration<InetAddress> enumAddr = ifc.getInetAddresses();
							enumAddr.hasMoreElements(); ) {
						InetAddress address = enumAddr.nextElement();
						if (address instanceof Inet4Address && !address.isLoopbackAddress()) {
							return address.getHostAddress();
						}
					}
				}
			}
		}
		catch (IOException e) {
			// ignore
		}

		return "unknown";
	}
Return a non loopback IPv4 address for the machine running this process.
If the machine has multiple network interfaces, the IP address for the
first interface returned by {@link java.net.NetworkInterface#getNetworkInterfaces}
is returned.

@return non loopback IPv4 address for the machine running this process

@see java.net.NetworkInterface#getNetworkInterfaces
@see java.net.NetworkInterface#getInetAddresses
spring-xd-dirt/src/main/java/org/springframework/xd/dirt/util/RuntimeUtils.java