After turning out of the API, take it out. . . Especially suitable for multiple IP addresses
import java.net.InetAddress; import java.net.NetworkInterface; import java.net.SocketException; import java.net.UnknownHostException; import java.util.Enumeration; public class GetIP {public static void main (String [] args) throws UnknownHostException, SocketException {System.out.println ( "Host: / t" InetAddress.getLocalHost () "/ n"); Enumeration