Fixing java.net Local host name unknown error on Mac OS X
来源:互联网 发布:造价工程师考试软件 编辑:程序博客网 时间:2024/06/08 13:23
As some of you might know, I am a big fan of modular software (functional modules). So I love OSGi. Snofyre is built on OSGi and Spring DM. Anyways, since I am in the process of rewriting Snofyre, I decided to rebase the previous OSGi code to a new OSGi framework. When doing this, I got a bizzare error at launch:
Error: Exception thrown by the agent : java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException: MB: MB: nodename nor servname provided, or not known
For someone who’s lived in the Java world for a while, this is something I found rather strange. I did all the sanity checks on my /etc/hosts file to ensure proper entries were present but still had no luck! I even tried reseting theComputer Name from System Preferences, still no joy! And then it struck me, that Mac OS X might have got itself in a twist and I had to set the ‘HostName’ manually. Doing that using Terminal is real easy using scutil. Here is how:
scutil –set HostName “localhost”
See screenshot below, where my previous HostName was set to ‘MB‘. I changed it to ‘localhost‘ using the above command. You can use scutil –get HostName to get the current hostname.
You can read more about scutil here. Remember, you need to change the hostname to something that exists in your /etc/hosts file, otherwise you might still keep getting the UnknownHostException!
- Fixing java.net Local host name unknown error on Mac OS X
- 解决Mac java.net Local host name unknown error的方法
- 解决Mac java.net Local host name unknown error的方法
- 解决Mac java.net Local host name unknown error的方法
- [SAP]解决Mac java.net Local host name unknown error的方法
- java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostExce
- java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException
- Mac Idea配置启动出错(java.net.MalformedURLException: Local host name unknown: **)
- Mac tomcat启动报错Local host name unknown: java.net.UnknownHostException: bogon: bogon: nodena
- Mycat 启动失败 java.net.MalformedURLException: Local host name unknown:
- 代理抛出异常错误: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException:
- 代理抛出异常错误: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException:***
- 错误: 代理抛出异常错误: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException
- Ubuntu Linux下tomcat报错java.net.MalformedURLException: Local host name unknown: java.net
- 代理抛出异常错误: java.net.MalformedURLException: Local host name unknown: java.net.UnknownHostException:
- Tomcat Linux下启动不了(java.net.MalformedURLException: Local host name unknown: java)
- tomcat启动报错java.net.MalformedURLException: Local host name unknown
- tomcat启动报错java.net.MalformedURLException: Local host name unknown
- IM------XMPP协议
- IntelliJ IDEA 问题总结之二(待补充) —— 快捷键、主题样式、导出jar、sqlite
- Python_cmd的各种实现方法及优劣(subprocess.Popen, os.system和commands.getstatusoutput)
- oracle统计字符串中某个字符出现的次数详解
- Beanshell remove first 0
- Fixing java.net Local host name unknown error on Mac OS X
- 对ip6tables rule操作
- OkHttp –Android、Java应用中的 HTTP & SPDY 客户端库
- 培训经理辞职引发的讨论
- Libgdx中TextButton的一些思考
- 部署tomcat错误解决
- [LeetCode]Merge Sorted Array
- Java垃圾回收机制
- Ceilometer整体结构