Skip to Main Content

Java APIs

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How can I get my Local IP Address?!?!

843790Jul 17 2006 — edited Jul 20 2006
I'm developing an applet, for which I need to get the local IP address of the computer where it's running on.

In Linux, the combination InetAddress.getLocalAddress().getHostAddress() works perfectly, but in Windows (both IE and Mozilla tested) it always returns 127.0.0.1!!! I guess this is caused by some kind of security check (as the InetAddress.getLocalAddress doc says). I also tried the NetworkInterface + InetAddress combination, but I got the same result, just the loopback.

So, my question is: Is there a way to bypass this check? I really need to get the "real" local IP address, cause it's part of an authentication scheme for the local user.

Thanks a lot for your help.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 17 2006
Added on Jul 17 2006
7 comments
373 views