aspose file tools*
The moose likes Distributed Java and the fly likes get IP, but not 127.0.0.1 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Distributed Java
Bookmark "get IP, but not 127.0.0.1" Watch "get IP, but not 127.0.0.1" New topic
Author

get IP, but not 127.0.0.1

Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Howdy!

How can I get IP, but not 127.0.0.1.
Thank you!

java.net.InetAddress i = java.net.InetAddress.getLocalHost();
System.out.println(i.getHostAddress());
Leandro Coutinho
Ranch Hand

Joined: Mar 04, 2009
Posts: 417
Howdy!

I could solve my problem.

Mike Peters
Ranch Hand

Joined: Oct 10, 2009
Posts: 67

You can also iterate over the network interfaces in Java. For example:



Mike Peters
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: get IP, but not 127.0.0.1