mac:macOS Sierra 10.12.2
eclipse:Version: Neon.1a Release (4.6.1)
debug时进度一直停在93%,然后超时报错:
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一下,在*找到了解决方案,在hosts中加入
127.0.0.1 localhost
-hosts修改方法:
hosts不能直接在/etc中修改;
在Finder中,点击shift+command+G,输入/etc,将hosts文件拷贝到桌面,修改后再拷贝回去(需要输入密码)。
再次debug,正常!
- 参考: