有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

调试时Eclipse在java 8类加载器上中断

在我的一些项目中,我迁移到了java 8,并注意到设置为使用java 8运行的每个项目在调试时都会毫无理由地中断

当我在调试模式下运行项目时,Eclipse只是在类加载器的第436行中断,这是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
} 

然后我必须点击play,一切都很好,但每次我想调试一个让我抓狂的应用程序时,都这么做真是太好了。。试图找到任何与此相关的东西,但没有成功

我还检查了breakpoints视图,发现有任何问题。还检查了Skip all breakpoints按钮,但似乎什么也没发生

还可以下载一个新的干净的Eclipse,并且仍然在进行

以下是一个截图:

debug breakpoint


共 (1) 个答案

  1. # 1 楼答案

    我通过禁用步进过滤来修复它

    enter image description here