简体   繁体   English

调试时,Eclipse使用java 8打破ClassLoader

[英]Eclipse breaking on ClassLoader with java 8 when debugging

I migrated to java 8 in some of my projects, and noticed that every project that is set to run with java 8 breaks with no reason when debugging them.. 我在一些项目中迁移到java 8,并注意到在调试它们时,每个设置为使用java 8运行的项目都没有理由中断。

When I run the project in debug mode, Eclipse just breaks in the class ClassLoader at line 436 which is the closing curly brace of a synchronized 当我在调试模式下运行项目时,Eclipse只是在第436行的类ClassLoader中断,这是synchronized的结束大括号

Here is the part of the code of the class that is in the jre lib 这是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
} 

Then I have to click on play and everything goes fine, but it is so anyonying to do this every time I want to debug an app that is driving me crazy.. Tried to find anything related to this but with no luck. 然后我必须点击播放,一切都很顺利,但每次我想调试一个让我疯狂的应用程序时,这样做是不经意的。尝试找到任何与此相关但没有运气的东西。

I also checked the breakpoints view and there are any. 我还检查了断点视图,有任何。 Also checked the Skip all breakpoints button but nothing seems to happen. 还检查了“ Skip all breakpoints按钮但似乎没有发生任何事情。

Also get to the point of downloading a new clean Eclipse and still happening. 也可以下载一个新的干净的Eclipse并且仍在发生。

Here is an screenshot: 这是一个截图:

调试断点

I fixed it by disabling Step Filtering 我通过禁用步骤过滤来修复它

在此输入图像描述

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

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