简体   繁体   English

在eclipse中无法对java文件应用调试

[英]Can't apply debug on java file in eclipse

On applying breakpoints to a java file in debug mode, the breakpoints are not stopping the control flow of that file. 在调试模式下将断点应用于java文件时,断点不会停止该文件的控制流。 However, the breakpoints are stopping the control flow on another file in the same package. 但是,断点正在停止同一包中另一个文件的控制流。 When i apply breakpoints on one file the break point changes to a circle with tail and the break point stops the control flow while on applying it to other file it remains a circle only and does not stop the control flow. 当我在一个文件上应用断点时,断点会变为带尾的圆,断点会停止控制流,而在将其应用到其他文件时,它只保留一个圆并且不会停止控制流。 How to get the break point to stop the control flow? 如何获得断点来停止控制流程?

Working: 工作: 在此输入图像描述

Not working: 不工作: 在此输入图像描述

Ok as you have mentioned as a reply to my comment that you are doing remote appliction debugging. 好的,正如您在回复我的评论时提到的那样,您正在进行远程应用程序调试。 So most likely the problem is that you have different version of code in your server and in your eclipse. 因此,最有可能的问题是您的服务器和日食中有不同版本的代码。

In short it seems that executable doesn't map their source lines all that well to the generated .java file source lines. 简而言之,似乎可执行文件不会将其源代码行映射到生成的.java文件源代码行。 So what looks like a source line in your real source isn't actually executable in the generated source, so it can't actually sustain a breakpoint. 所以看起来像真实源中的源代码行实际上并不是在生成的源代码中可执行的,因此它实际上不能维持断点。

Hope it helps! 希望能帮助到你!

请保证您的代码和服务器保持一致,否则会有这个问题。

Circle with tail : Breakpoint is successfully set because Your Source code matches with the Byte Code and debug control will reach there. 带尾部的圆 :断点已成功设置,因为您的源代码与字节代码匹配,并且调试控制将到达那里。

Only Circle : Source code differs from Byte code (May be you are running a older Snapshot of code). Only Circle :源代码与字节代码不同(可能是您运行较旧的代码快照)。 Control will never reach at this breakpoint. 控制将永远不会达到此断点。 You will have to update your JARs to get control to these breakpoints. 您必须更新JAR才能控制这些断点。

Solution : In case of remote debugging this happens often, you can get your problem solved by replacing older JARs with new ones obtained after building your project. 解决方案 :如果经常进行远程调试,您可以通过将新JAR替换为构建项目后获得的新JAR来解决问题。

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

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