我在我的一些项目中迁移到 java 8,并注意到每个设置为使用 java 8 运行的项目在调试时都会无缘无故地中断......
当我在 Debug模式下运行项目时,Eclipse 只是在第 436 行的类 ClassLoader 中中断,这是 synchronized
这是jre lib中类的部分代码
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
}
然后我必须点击播放,一切顺利,但每次我想调试一个让我发疯的应用程序时,这样做太麻烦了。试图找到与此相关的任何东西,但没有运气。
我也检查了断点 View ,有任何。还检查了 Skip all breakpoints
按钮,但似乎没有任何反应。
还要下载一个新的干净的 Eclipse 并且仍在进行。
截图如下:
最佳答案
关于java - 调试时使用 Java 8 在 ClassLoader 上中断 Eclipse,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28118467/