How does VBJ determine my machine's default IP? What is the default

By: Borland Developer Support

Abstract: Solution 10550

Question:

How does VBJ determine my machine's default IP? What is the default IP of the local machine? (localhost, default hostname)

Answer:

Build and run this simple java program to see what VBJ is seeing when it tries to determine your machine's IP address. If a value starting with 127 is returned then your machine's network is not configured properly and VBJ will not be able to access resources that are running on any other machine.

---------------------------------------------------------
defIP.java
---------------------------------------------------------
import java.net.*;
import java.io.*;

public class defIP {
  public static void main(String[] args) {
    try {
      System.out.println(InetAddress.getLocalHost());
    } catch (UnknownHostException e) {
      System.out.println( e );
    }
  }
}
---------------------------------------------------------
 

Server Response from: SC1