在Mac上无法打开h2.jar

4
我正在尝试为我的Java应用程序构建一个H2数据库,我认为它正在工作,但我无法执行.jar文件来查看它是否工作......我和我的朋友一起做这件事,他有一个Mac,它对他很好,我们有相同的Java版本。
我尝试双击.jar文件打开它,也尝试使用命令行打开它: java -jar h2-1.3.170.jar 但是它显示了一个异常。
IO Exception: "java.net.UnknownHostException: dhcp-10-231-195-255: dhcp-10-231-195-255: nodename nor servname provided, or not known" [90028-170]

    at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
    at org.h2.message.DbException.get(DbException.java:158)
    at org.h2.message.DbException.convert(DbException.java:273)
    at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:263)
    at org.h2.server.web.WebServer.updateURL(WebServer.java:325)
    at org.h2.server.web.WebServer.init(WebServer.java:315)
    at org.h2.tools.Server.<init>(Server.java:51)
    at org.h2.tools.Server.createWebServer(Server.java:412)
    at org.h2.tools.Console.runTool(Console.java:228)
    at org.h2.tools.Console.main(Console.java:100)
Caused by: java.net.UnknownHostException: dhcp-10-231-195-255: dhcp-10-231-195-255: nodename nor servname provided, or not known
    at java.net.InetAddress.getLocalHost(InetAddress.java:1438)
    at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:261)
    ... 6 more
Caused by: java.net.UnknownHostException: dhcp-10-231-195-255: nodename nor servname provided, or not known
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258)
    at java.net.InetAddress.getLocalHost(InetAddress.java:1434)
    ... 7 more
Exception in thread "main" org.h2.message.DbException: IO Exception: "java.net.UnknownHostException: dhcp-10-231-195-255: dhcp-10-231-195-255: nodename nor servname provided, or not known" [90028-170]
    at org.h2.message.DbException.get(DbException.java:158)
    at org.h2.message.DbException.convert(DbException.java:273)
    at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:263)
    at org.h2.server.TcpServer.getURL(TcpServer.java:193)
    at org.h2.tools.Server.getStatus(Server.java:391)
    at org.h2.tools.Console.printProblem(Console.java:300)
    at org.h2.tools.Console.runTool(Console.java:270)
    at org.h2.tools.Console.main(Console.java:100)
Caused by: org.h2.jdbc.JdbcSQLException: IO Exception: "java.net.UnknownHostException: dhcp-10-231-195-255: dhcp-10-231-195-255: nodename nor servname provided, or not known" [90028-170]
    at org.h2.message.DbException.getJdbcSQLException(DbException.java:329)
    ... 8 more
Caused by: java.net.UnknownHostException: dhcp-10-231-195-255: dhcp-10-231-195-255: nodename nor servname provided, or not known
    at java.net.InetAddress.getLocalHost(InetAddress.java:1438)
    at org.h2.util.NetUtils.getLocalAddress(NetUtils.java:261)
    ... 5 more
Caused by: java.net.UnknownHostException: dhcp-10-231-195-255: nodename nor servname provided, or not known
    at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method)
    at java.net.InetAddress$1.lookupAllHostAddr(InetAddress.java:866)
    at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1258)
    at java.net.InetAddress.getLocalHost(InetAddress.java:1434)
    ... 6 more

你能检查一下你的/etc/hosts文件吗?你使用VPN或特殊防火墙吗?你默认使用IPv6并禁用了IPv4吗? - Thomas Mueller
不,我刚刚查看了一下,没有你提到的那种情况。 - user2167441
2个回答

4

2

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接