java.net.UnknownHostException on OSX and Java 7

7,416 views
Skip to first unread message

Oliver Schrenk

unread,
Dec 21, 2012, 6:04:36 AM12/21/12
to h2-da...@googlegroups.com
Hi,

Just and FYI for all users on OSX using Java 7. I was trying to start a TCP Server from within an application using

Server.createTcpServer().start();

and got

org.h2.jdbc.JdbcSQLException: "java.net.UnknownHostException: MacBook: MacBook: nodename nor servname provided, or not known"
IO Exception: "java.net.UnknownHostException: MacBook: MacBook: nodename nor servname provided, or not known" [90028-170]

This is a bug in the JDK 7 for OSX as noted in [1] (login required) and more recently on [2]

The workaround is to add the name of the machine to your `/etc/hosts` file, in my case

127.0.0.1 MacBook

Best regards
Oliver Schrenk


OSX 10.8.2
JDK 7u10

Jonathan Shuali

unread,
Sep 2, 2014, 11:28:39 AM9/2/14
to h2-da...@googlegroups.com
Thank you Oliver so much.

I had this problem and could not figure out why.

Jonathan.
Reply all
Reply to author
Forward
0 new messages