NetBeans和停止所有例外/休息?

编程入门 行业动态 更新时间:2024-10-18 06:08:47
本文介绍了NetBeans和停止所有例外/休息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

所以使用NetBeans作为我的IDE开发Android林。

So Im using NetBeans as my IDE for developing Android.

然而,当我得到一个异常,Netbeans的不上除了打破,因为我希望它。

However, when I get an exception, Netbeans does not break on the exception as I expect it to.

我检查了盒子停止对未捕获的异常,可以中找到的选项 - > Java调试 - >停止对未捕获的异常的,但是这并不能帮助

I have checked the box "Stop on uncaught exceptions" that can be found in Options --> Java Debugger --> Stop on uncaught exceptions but that doesn't help.

此外,我在这里可以看到实际的异常消息?我没有看到任何东西。现在我不知道何时何地发生异常,只是它确实发生了。

Furthermore, where can I see the actual exception message? I dont see anything. Right now I have no clue where and when an exception occurs, just that it does occur.

我读过一些关于netbeans(缓存,该网站似乎是向下)有关固定在6.9.1中的错误,但它不似乎定格在7.0,我有。

I've read some on the netbeans (cached, the site seems to be down) about a bug in 6.9.1 that was fixed, but it doesnt seem to be fixed in 7.0 that I have.

调试窗口犯规说什么都有益,给人某种形式的AV堆栈跟踪这是毫无意义的因为它没有指定任何我自己的code。

The debugging window doesnt say anything useful at all, gives some form av stacktrace that is pointless as it doesnt specify any of my own code.

我从Eclipse的原因切换的IDE很烂,NetBeans是更为精简,但调试需要固定是有用的......

I switched from Eclipse cause that IDE sucks, NetBeans is much leaner, but the debugging needs to be fixed to be useful...

推荐答案

我有这样的问题,当我使用NetBeans了。为了获得异常消息,我用试一收。在catch()语句,调用包含一些code函数,并把一个断点就可以了。然后,当异常给你的断点在catch语句将被调用,你可以阅读从异常obect信息(错误信息,栈,等等)。

I have this problem when I use netbeans too. To get the exception message, I use try-and-catch. In the catch() statement, call a function that contains some code and put a breakpoint on it. Then when the exception is given your breakpoint in the catch statement will be called and you can read the information (error message, stack, etc.) from the Exception obect.

try { // Doing something here } catch (Exception e1) { // This is called when an exception occurs doSomething(); /// Put breakpoint here }

更新:

我不知道这是否会工作的机器人,但你可以尝试进入新建断点。当进入一个新的断点打破例外,你需要知道的 确切的包/类异常名称。例如,如果你想赶上一个 NullPointerException异常,那么你去调试>>新建断点创建一个新断点,然后输入 显示java.lang.NullPointerException到的异常类名称字段 断点属性对话框。选择是否打破抓,未捕获或两者的异常,如果这类型的异常以往任何时候都发生在类/项目将打一个断点。

I am not sure if this will work for android but you could try entering a "New Breakpoint". When entering a new breakpoint to break on an exception, you need to know the exact package/class exception name. For example, if you want to catch a NullPointerException, then you go to Debug >> New Breakpoint to create a New Breakpoint and enter java.lang.NullPointerException into the Exception Class Name field in the Breakpoint Properties dialog. Choose whether to break on caught, uncaught or both, exceptions and it will hit a breakpoint if that type of exception ever occurs in the class/project.

更多推荐

NetBeans和停止所有例外/休息?

本文发布于:2023-11-07 10:49:58,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1566252.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:NetBeans

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!