Is it possible to add breakpoints to a class which I don't have the source code for?

倾然丶 夕夏残阳落幕 提交于 2019-12-05 07:21:19

Download jad decompiler /configure its path in eclipse through windows->preferences and open the source of the class where you need to place the breakpoint - and then debug can run as it does normally and you can see all the variable information in the variable view.

If you open the outline view, you can select a method, right-click and select Toggle Method Breakpoint, this will then break whenever the method is hit.

You may be able to get the sources from Sun's archive download page

As mentioned by Rich, the outline view (available even without sources):

alt text http://help.eclipse.org/ganymede/topic/org.eclipse.platform.doc.user/images/ref-8.png

allows you to set method breakpoint, that is, provided javac compiled those classes with debug informations, including "Source Code information" (that is the case with J2EE1.4, not sure about J2EE1.3)

The source code of J2EE 1.3 should be available and be included with the download center j2sdkee-1_3_1-win.exe file.

It depends, I think, on whether the class was compiled with debug information. If so, then the class file contains meta-data such as line numbers and parameter names which the debugger needs to make a decent fist of it. If not, then the debugger has less information to go on.

JavaEE libraries are notorious for not having debug meta-data compiled into them. It can be quite frustrating.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!