Eclipse Mac OS X Debug Error: “FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)”

不问归期 提交于 2019-12-30 06:26:31

问题


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)

OS: Mac OS X 10.10.2 MacBook Pro with Retina Display java version "1.8.0_25" Java(TM) SE Runtime Environment (build 1.8.0_25-b17) Java HotSpot(TM) 64-Bit Server VM (build 25.25-b02, mixed mode)

I'm not sure why debug is failing and resulting in these errors. I haven't changed/updated anything that I can recall.

Any advice? I realize this question has already been asked, but not for Mac OS X and the answers were unclear for me. What should I try?


回答1:


I had exactly the same issue (on OSX), in my case the line in /etc/hosts was commented out:

127.0.0.1    localhost

It's explained in Eclipse Wiki: https://wiki.eclipse.org/Debug/FAQ#I_can_run_a_program_but_not_debug_it.3F.3F.3F




回答2:


Resolved Issue by editing /etc/hosts file: I also had similar issue(Able to ping 127.0.0.1, but issue while pinging localhost, debug from eclipse not working). I resolved it by removing entries like ::1 localhost, ff81::1%lo0 localhost with only 127.0.0.1 localhost.... I removed rest of the entries for localhost. I did this for my mac.

After this process I can debug my java application using eclipse.

Sometime, what ever information that I given is not working. In that case, I just moved the file /etc/hosts file to hosts_backup. then restored the file. ie moved file hosts_backup to /etc/hosts. then it starts working. Don't know how it is working. But it resolved my issue



来源:https://stackoverflow.com/questions/29188789/eclipse-mac-os-x-debug-error-fatal-error-in-native-method-jdwp-no-transports

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!