问题
I am using a jdb dubugger, and the problem with it that is stops on every caught exception, though I did not execute any catch .... statements. During class loading there are hundreds of them:
Exception occurred: java.io.FileNotFoundException (uncaught)"thread=Thread-2-EmulatorEngine", sun.misc.URLClassPath$JarLoader.ensureOpen(), line=634 bci=30
Is it any way to instruct jdb to skip these exceptions ?
PS. I have heard about IDE editors of cause. Have reasons to use jdb.
回答1:
I realized that I am not careful enough. JDB writes after launch these lines
Set uncaught java.lang.Throwable
Set deferred uncaught java.lang.Throwable
So, to disable that, I need to enter a command
ignore uncaught java.lang.Throwable
回答2:
If you're having the same issue as me, you need to use the fully qualified name of the class when defining the break point.
Example - Set break point in main method: stop in com.foo.bar.App.main
It may be that you are trying to set a break point for a class file different than the one you are debugging (which probably doesn't exist).
来源:https://stackoverflow.com/questions/11312882/jdb-stops-on-every-exception-how-to-prevent-this