Could not open h2.jar on mac

I am trying to create an H2 database for my Java application and I think it works, but I cannot execute the .jar file to see if it works or not ........ I do this with my friend which has a poppy and it works well for it, we have the same version of Java

I tried double-clicking on .jar and I tried to open it using the command line

java -jar h2-1.3.170.jar and it showed me that exception

 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 
+4
source share
2 answers

To temporarily fix it, edit the host files and add the host name to 127.0.0.1 feedback address:

 sudo vi /etc/hosts 

127.0.0.1 localhost YourHostname

255.255.255.255 broadcasthost

:: 1 localhost

fe80 :: 1% lo0 localhost

192.168.1.3 loki

To install it first, use:

sudo scutil --set HostName YourHostname

Follow this JIRA Link for more information: https://jira.exoplatform.org/browse/KER-203?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

+4
source

If you do a Google search for this exception, you will find others having the same problem. This may be caused by a bug in Java 7 .

+2
source

Source: https://habr.com/ru/post/1469081/


All Articles