简体   繁体   English

无法在新安装的mac上以调试模式启动eclipse中的应用程序

[英]Can't start applications in eclipse in debug mode on newly installed mac

I have reinstalled snow leopard (10.6.4) and it's fully updated. 我重新安装了雪豹(10.6.4)并且它已经完全更新了。 Running java -version gives me: 运行java -version给了我:
Java version "1.6.0_20" Java版“1.6.0_20”
Java(TM) SE Runtime Environment (build 1.6.0_20-b02-279-10M3065) Java(TM)SE运行时环境(版本1.6.0_20-b02-279-10M3065)
Java HotSpot(TM) Client VM (build 16.3-b01-279, mixed mode) Java HotSpot(TM)客户端VM(版本16.3-b01-279,混合模式)

I have installed a fresh version of eclipse (helios, 3.6, build: 20100617-1415). 我安装了一个新版本的eclipse(helios,3.6,build:20100617-1415)。

I create a new java project, add a simple test case: 我创建一个新的java项目,添加一个简单的测试用例:

public class TestMyEclipse {  
      @Test  
      public void testIt() {  
       assertTrue(true);  
      }  
}

When I run this in normal mode in eclipse it works as expected. 当我在eclipse中以正常模式运行它时,它按预期工作。 But when I run it in debug mode I get the following error: 但是当我在调试模式下运行时,我收到以下错误:

Invalid memory access of location 0x14 rip=0x1007f9d22

The problem is that your localhost has been removed from your hosts entry. 问题是您的localhost已从主机条目中删除。 I've posted a blog entry detailing how I fixed it. 我发布了一篇博文,详细介绍了我如何修复它。 http://yadg.blogspot.com/2011_01_01_archive.html http://yadg.blogspot.com/2011_01_01_archive.html

I found another blog which describes the problem and the solution in greater detail. 我发现了另一个博客,它更详细地描述了问题和解决方案。 Here is the link if it helps: 如果它有帮助,这是链接:

http://apachefelix.blogspot.com/2012/05/offtopic-mac-cant-resolve-localhost-and.html http://apachefelix.blogspot.com/2012/05/offtopic-mac-cant-resolve-localhost-and.html

Type /private/etc in the finder. 在finder中输入/ private / etc。

Look for the hosts file. 查找hosts文件。 Edit it and paste: 编辑并粘贴:

127.0.0.1 localhost 127.0.0.1 localhost

I used sublime and it'll ask sudo credentials before saving the modified file. 我使用了sublime,它会在保存修改后的文件之前询问sudo凭据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM