ERROR: transport error 202: gethostbyname: unknown host
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPO
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
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