无法使用eclipse调试Java [英] Unable to debug in Java with eclipse

查看:142
本文介绍了无法使用eclipse调试Java的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Eclipse作为IDE在我的机器上调试一个简单的Java应用程序。当我尝试通过输入Debug Perspective来调试应用程序时,我设置了一个断点并开始调试。在几秒钟内,弹出的窗口如下:

I am trying to debug a simple Java application on my machine using Eclipse as an IDE. When I try to debug the application by entering the Debug Perspective, I set a breakpoint and start debug. Within a few seconds, the following pop-up window:

启动unicodeRead遇到问题。无法连接到VM ​​

转储在控制台上的消息如下:

The message dumped on the console is as follows:

ERROR: transport error 202: connect failed: Connection refused
ERROR: JDWP Transport dt_socket failed to initialize, TRANSPORT_INIT(510)
JDWP exit error AGENT_ERROR_TRANSPORT_INIT(197): No transports initialized [../../../src/share/back/debugInit.c:708]
FATAL ERROR in native method: JDWP No transports initialized, jvmtiError=AGENT_ERROR_TRANSPORT_INIT(197)  

我该如何更正?为什么会发生这种情况?

How do I correct this? Why does this happen?

推荐答案

我刚刚遇到同样的问题。

I just had the same problem.

昨天一切都很好,现在没有什么 - 同样的错误,你给了。我发现网络管理员在此期间做了一些改变。一些防火墙的东西问题是Eclipse试图在localhost(和一些随机端口)上建立到JVM的连接。当我尝试ping localhost(或127.0.0.1)我得到以下内容:

Yesterday everything worked fine, now nothing - same error as you gave. I found out that network admins made some changes in the meantime. Some firewall stuff. Problem is that Eclipse tries to establish connection to JVM at "localhost" (and some random port). When I tried pinging localhost (or 127.0.0.1) I got following:

C:\Windows\system32>ping 127.0.0.1
Pinging 127.0.0.1 with 32 bytes of data:
PING: transmit failed. General failure.
PING: transmit failed. General failure.
PING: transmit failed. General failure.
PING: transmit failed. General failure.

C:\Windows\system32>ping localhost
Ping request could not find host localhost. Please check the name and try again.

在某些情况下,DNS有望解决此问题,如果防火墙阻止本地主机向DNS请求 - 休息。我不得不修改主机文件并删除以下行中的注释,所以我不再依赖DNS了:

It seams that in some cases DNS is expected to resolve this, and if firewall prevents localhost requests to DNS - stuff breaks. I had to alter hosts file and remove comments in following lines, so I would not rely on DNS for this anymore:

# 127.0.0.1       localhost
# ::1             localhost

虽然写入的是主机文件更改效果立即,我认为一些进程锁定这个,重新启动是必要的在我的情况。之后,一切都重新开始。

Although it is written that hosts file changes take effect immediately, I think that some processes locked this and restart was necessary in my case. After that, everything worked again.

这篇关于无法使用eclipse调试Java的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆