Java IP Address Get getLocalIP()

Here you can find the source of getLocalIP()

Description

get Local IP

License

Apache License

Declaration

public static String getLocalIP() 

Method Source Code

//package com.java2s;
//License from project: Apache License 

import java.net.*;

public class Main {

    public static String getLocalIP() {
        try {/*from  w w w. j  a  v a2 s .  c o m*/
            return InetAddress.getLocalHost().getHostAddress();
        } catch (UnknownHostException e) {
            e.printStackTrace();
        }
        return null;
    }
}

Related

  1. getLocalIp()
  2. getLocalIp()
  3. getLocalIp()
  4. getLocalIP()
  5. getLocalIP()
  6. getLocalIP()
  7. getLocalIP()
  8. getLocalIp()
  9. getLocalIP()