My Java Internet connectivity check always fails
<p>I need to check for Internet connectivity in my Java app. I created this simple program, but it always says false.</p>

<pre><code>import java.io.IOException;
import java.net.InetAddress;
import java.net.UnknownHostException;

public class Internet {

public static void main(String args[]){
    String host = "209.85.175.104";
    int timeOut = 10000; // I recommend 3 seconds at least
    try {
        boolean status = InetAddress.getByName(host).isReachable(timeOut);
        System.out.println(status);
    } catch (UnknownHostException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    } catch (IOException e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
    }
   }

}
</code></pre>

<p>I tried <code>String host = "www.google.com";</code> I got that IP address by pinging in my terminal and copying it.</p>
