The solution to the failure of jar package startup prompt java Name or service not known
This article introduces the "jar package startup failure prompt java Name or service not known solution" related knowledge, in the actual case operation process, many people will encounter such a dilemma, and then let the editor lead you to learn how to deal with these situations! I hope you can read it carefully and be able to achieve something!
I found that I could not start the jar package when I used the startup script of the written jar package on a machine in the production environment. Then I used the java command to start the jar package separately. The following error occurred
Root@aly-gz-web-1:/etc/init.d# java-Dfile.encoding=UTF-8-Xmx2048M\-Dcom.sun.management.jmxremote\-Dcom.sun.management.jmxremote.port=30113\-Dcom.sun.management.jmxremote.authenticate=false\-Dcom.sun.management.jmxremote.ssl=false\-jar / data/appdata/kjyl_1000020/kjly.jarError: Exception thrown by the agent: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: aly-gz-web-1: aly-gz -web-1: Name or service not known this error is caused because the server cannot find the ip corresponding to the current hostname
Then I went to check the local / etc/hosts file and found that there was a problem with the mapping between the public network IP of the machine and the hostname of the machine in the hosts file, and then modified it to normal, as follows:
# Editing / etc/hosts file vim / etc/hosts# with problem 154.188.27.71 aly-gz-web-100# modified (correct hostname) 154.188.27.71 aly-gz-web-1
Finally, the jar package startup script is executed and started successfully.
Root@aly-gz-web-1:/etc/init.d# / etc/init.d/kjyl_1000020 start {"changed": true, "changes": "kjyl_1000020 start Success"} "jar package startup failure prompt java Name or service not known solution" content here, thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!