转 解决eclipse debug报错

【原始链接】http://apachefelix.blogspot.com/2012/05/offtopic-mac-cant-resolve-localhost-and.html

Offtopic: Mac can't resolve localhost and Eclipse Debug Mode does not work

 
I always had problems to run eclipse in debug mode. 
Error: Invalid memory access of location 0x14 rip=0x######## 


After reading millions of forum posts i found out that it could be related to a other problem i had since a long time.
If i try to ping localhost, it says can't resolve localhost.


The problem is that /etc/hosts is empty.


You can check this by open the command line tool and write "sudo nano /etc/hosts" or "sudo vi /etc/hosts". If the file is blank you propably got the same problem like me. Good for you that i found a solution:


1. Open Command line
2. Copy that:

##
# Host Database
#
# localhost is used to configure the loopback interface
# when the system is booting.  Do not change this entry.
##
127.0.0.1       localhost
255.255.255.255 broadcasthost
::1             localhost 
fe80::1%lo0     localhost



3. Type: "sudo nano /etc/hosts" or "sudo vi /etc/hosts"
4. If a blank file is show. Rightclick and Paste.
5. Save the File.
6. Try "Ping localhost"


Also Eclipse shoud now be able to run the Debugmode.
 
Troubleshooting:

You were trying to save the file but it failed because of "Error writing hosts: No such file or directory".
The Problem is that the file is a alias file and just references to nowhere.
Ok do Step 1 and 2. After that Type: "sudo nano /etc/hosts2" or "sudo vi /etc/hosts2".
Do step 4 and 5.
Than go to /etc/ and type "mv hosts hosts3" and "mv hosts2 hosts"
Go step 6. :)


OR


type: "rm /etc/hosts" and start from step1.

转载于:https://www.cnblogs.com/cszjutstar/archive/2013/03/27/2985126.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值