mac:macOS Sierra 10.12.2
eclipse:Version: Neon.1a Release (4.6.1)
debug时进度一直停在93%,然后超时报错:
![img_a6848c0098f1093cd58eeca5bb423a66.png](https://yqfile.alicdn.com/img_a6848c0098f1093cd58eeca5bb423a66.png?x-oss-process=image/resize,w_1400/format,webp)
ERROR: transport error 202: gethostbyname: unknown host
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [debugInit.c:750]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)
分析错误提示,是找不到主机host,google一下,在stackoverflow找到了解决方案,在hosts中加入
127.0.0.1 localhost
-hosts修改方法:
hosts不能直接在/etc中修改;
在Finder中,点击shift+command+G,输入/etc,将hosts文件拷贝到桌面,修改后再拷贝回去(需要输入密码)。
再次debug,正常!
![img_b38421b178a2cddf24b9e8e0f820764a.png](https://yqfile.alicdn.com/img_b38421b178a2cddf24b9e8e0f820764a.png?x-oss-process=image/resize,w_1400/format,webp)
- 参考: