source not found when debugging

来源:互联网 发布:windows平板推荐 2016 编辑:程序博客网 时间:2024/05/01 06:07

While debugging and keep pressing F5, if the source code does not exist, eclipse will open a new window declaring that the source was not found.

How can I make eclipse to only try to step in the code (while I am pressing F5 all the time) if the source code exist and if it does not exist, it would just automatically step over it instead of this "Source not found page". Is this possible?

ANSWER:

The best you can do is to use Step Filters. Step filters prevent the debugger from suspending in specified classes and packages when stepping into code. Step filters are established with the Java > Debug > Step Filtering preference page. => i.e. you need to manually exclude types or packages for which you do not have source.

A quick way to keep adding step filters as you go along - in the Debug view, the selected stack frame's package or declaring type can be quickly added to the list of filters by selecting Filter Type or Filter Package from the stack frame's context menu.


--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

A .jar file usually only contains the .class files, not the .java files they were compiled from. That's why eclipse is telling you it doesn't know the source code of that class.

"Attaching" the source to a JAR means telling eclipse where the source code can be found. Of course, if you don't know yourself, that feature is of little help. Of course, you could try googling for the source code (or check wherever you got the JAR file from).

That said, you don't necessarily need the source to debug.




0 0
原创粉丝点击