# got a "Network is unreachable" exception in Java?

## larmbr

I write a small java application, but when I ran it I got exception like this:

```
java.net.SocketException: Network is unreachable

   at java.net.PlainSocketImpl.socketConnect(Native Method)

   at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)

   at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)

   at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)

   at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:391)

   at java.net.Socket.connect(Socket.java:579)

```

I hava try it on other's machine and it works well

I think I hava some mis-setting on my machine. Could anyone help?

----------

## kazanture

"Network is unreachable" means just that. You're not connected to a network.

Have you tried ping?

----------

