+2 votes
148 views
in Programming by (1.3k points)

I am getting this exception how to solve this error ?

java.net.UnknownHostException: Invalid hostname for server: local

1 Answer

+1 vote
by (2.1k points)

Because localhost is coming so should try host name with a ip 10.0.2.1

According to  the javadocs:  IP address of a host could not be determined.

if that local is a server on your network so you should add it to your host file and in DNS setting  also.

Not a Member yet?

Ask to Folks Login

My Account

Your feedback is highly appreciated