source not found when debugging

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.




评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值