I am tryin to get my local machines IP address using java InetAddress. I can check in my network connections the IP address mentioned there is something different than the one returned by the program.
Machine's IP address from network connections shows it to be 192.168.8.192, and the one returned by the program is 127.0.1.1.
I don't know what is wrong with my program.
I would really appreciate if anyone can help me with this.
InetAddress ina = InetAddress.getLocalHost();
System.out.println("LOCAL IP ADDRESS ===== >" +ina.getHostAddress() + "//" + ina.getHostName());
can anyone tell me what did I do wrong in this code ?