File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
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
 
Similar Threads
Tomcat clarification
HttpServletRequest. getRemoteAddr() is different from ipconfig /all
how to express Database url properly??
Regarding the BeatBox Server IP Address - Head First Java
Getting IP Address