【发布时间】:2011-01-29 02:37:55
【问题描述】:
如何设置 Eclipse 以在发生异常时停止。
我有一个 Eclipse 断点设置来中断异常。在下面的代码示例中,我遇到的问题是 Eclipse 尝试打开 Integer 源代码。有没有办法让调试器在我的代码示例中显示的点中断?如果我向下移动堆栈跟踪,我将到达这一行,如果有一种方法可以在不出现“未找到源”窗口的情况下执行此操作,那就太好了。
这可以在 Visual Studio 中完成,所以无法在 Eclipse 中找到方法让我发疯。
package com.test;
public class QuickTest
{
public static void main(String[] args)
{
try
{
test();
}
catch(NumberFormatException e)
{
System.out.println(e.getMessage());
}
}
private static void test()
{
String str = "notAnumber";
Integer.parseInt(str);//<----I want debugger to stop here
}
}
【问题讨论】:
标签: java eclipse debugging exception