调试时使用java 8在类加载器上中断Eclipse
我在一些项目中迁移到了java 8,并注意到设置为使用java 8运行的每个项目在调试它们时都会毫无理由地中断 当我在调试模式下运行项目时,Eclipse只是在类装入器的第436行中断,这是调试时使用java 8在类加载器上中断Eclipse,java,eclipse,debugging,breakpoints,Java,Eclipse,Debugging,Breakpoints,我在一些项目中迁移到了java 8,并注意到设置为使用java 8运行的每个项目在调试它们时都会毫无理由地中断 当我在调试模式下运行项目时,Eclipse只是在类装入器的第436行中断,这是synchronized 下面是jre库中类的部分代码 protected Class<?> loadClass(String name, boolean resolve) throws ClassNotFoundException { synchronized (getClass
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
}
受保护类loadClass(字符串名称,布尔解析)
抛出ClassNotFoundException
{
已同步(getClassLoadingLock(名称)){
//首先,检查类是否已加载
c类=findLoadedClass(名称);
如果(c==null){
long t0=System.nanoTime();
试一试{
如果(父项!=null){
c=parent.loadClass(名称,false);
}否则{
c=findBootstrapClassOrNull(名称);
}
}catch(classnotfounde异常){
//如果找不到类,则引发ClassNotFoundException
//从非空父类装入器
}
如果(c==null){
//如果仍然找不到,则按顺序调用findClass
//找到班级。
long t1=System.nanoTime();
c=findClass(名称);
//这是定义类装入器;记录统计信息
sun.misc.PerfCounter.getParentDelegationTime().addTime(t1-t0);
sun.misc.PerfCounter.getFindClassTime().AddeFalsedTimeFrom(t1);
sun.misc.PerfCounter.getFindClass().increment();
}
}
如果(解决){
(c)级;
}
返回c;
}//我通过禁用步进过滤来修复它
您的描述让我想起了Eclipse在@halfbit Thank中描述的(并非真正的)未捕获异常时令人烦恼的停止,我解决了这个问题。您可以发布一个答案,这样我就可以接受了。