【发布时间】:2015-03-22 23:56:30
【问题描述】:
我在一些项目中迁移到了 java 8,并注意到每个设置为使用 java 8 运行的项目在调试它们时都会无缘无故地中断..
当我在调试模式下运行项目时,Eclipse 只是在第 436 行的 ClassLoader 类中中断,这是 synchronized 的右花括号
这是 jre 库中类的部分代码
protected Class<?> loadClass(String name, boolean resolve)
throws ClassNotFoundException
{
synchronized (getClassLoadingLock(name)) {
// First, check if the class has already been loaded
Class<?> c = findLoadedClass(name);
if (c == null) {
long t0 = System.nanoTime();
try {
if (parent != null) {
c = parent.loadClass(name, false);
} else {
c = findBootstrapClassOrNull(name);
}
} catch (ClassNotFoundException e) {
// ClassNotFoundException thrown if class not found
// from the non-null parent class loader
}
if (c == null) {
// If still not found, then invoke findClass in order
// to find the class.
long t1 = System.nanoTime();
c = findClass(name);
// this is the defining class loader; record the stats
sun.misc.PerfCounter.getParentDelegationTime().addTime(t1 - t0);
sun.misc.PerfCounter.getFindClassTime().addElapsedTimeFrom(t1);
sun.misc.PerfCounter.getFindClasses().increment();
}
}
if (resolve) {
resolveClass(c);
}
return c;
} // <-- This is line 436 where it breaks just right after I click on the debug mode
}
然后我必须点击播放,一切都很好,但每次我想调试一个让我发疯的应用程序时都这样做是多么令人兴奋。试图找到与此相关的任何东西,但没有运气。
我还检查了断点视图,并且有。还检查了Skip all breakpoints 按钮,但似乎没有任何反应。
还可以下载一个新的干净的 Eclipse 并且仍在进行中。
这是截图:
【问题讨论】:
-
你的描述让我想起了 Eclipse 烦人地停在(不是真的)未捕获的异常处,如stackoverflow.com/questions/6290470/…中所述
-
@halfbit 谢谢,我解决了这个问题。您可以发布答案,以便我接受。
标签: java eclipse debugging breakpoints