java.net.UnknownHostException: host-192-168-10-48: Name or service not known
在ubuntu系统中执行【allure serve ***】的时候抱下面的错
java.net.UnknownHostException: host-192-168-10-48: Name or service not known at java.net.Inet6AddressImpl.lookupAllHostAddr(Native Method) at java.net.InetAddress$2.lookupAllHostAddr(InetAddress.java:929) at java.net.InetAddress.getAddressesFromNameService(InetAddress.java:1324) at java.net.InetAddress.getLocalHost(InetAddress.java:1501) at org.eclipse.jetty.server.Server.getURI(Server.java:726) at io.qameta.allure.Commands.open(Commands.java:135) at io.qameta.allure.Commands.serve(Commands.java:119) at io.qameta.allure.CommandLine.run(CommandLine.java:136) at java.util.Optional.orElseGet(Optional.java:267) at io.qameta.allure.CommandLine.main(CommandLine.java:72)
解决方法:
1.【vim /etc/hosts】
2.在hosts文件中添加一行:127.0.0.1 host-192-168-10-48