elipse 调试jdk时候变量不显示值以及解决办法
来源:互联网 发布:linux ln -s 编辑:程序博客网 时间:2024/05/16 18:44
今天以前的同事问我这个问题,我也不知道为什么。
问题是:当DEBUG自己程序的时候,调用了第三方的类库——比如JDK自己的类库——我们有这些类库的源码,进入随源码进入类库后,你会发现代码运行的行会在调试下一步步走,但鼠标指向变量时不再显示变量的值,选中->右键->watch也不能看到变量的值,什么原因?
我以前经常遇到这些问题,但从来没想过为什么不行,以为不是自己的类库就不显示,实际情况并非如此。
于是同事查了一下原因,发给了我,我就直接贴在这儿了。
Debug into rt.jar
August 4th, 2007
If you ever use Eclipse trying to debug into Java’s system APIs, such as java.lang.String or java.math.BigInteger, you may find that even you can step over or step in, or have the correct source file open and the correct line of codes highlighted, you still could not see the local variables’ value and method’s parameters are shown in pattern of “arg0″, “arg1″ and so on.
August 4th, 2007
If you ever use Eclipse trying to debug into Java’s system APIs, such as java.lang.String or java.math.BigInteger, you may find that even you can step over or step in, or have the correct source file open and the correct line of codes highlighted, you still could not see the local variables’ value and method’s parameters are shown in pattern of “arg0″, “arg1″ and so on.
Yes, you are already using JDK instead of JRE. But you still have the above problem. What’s wrong? It’s not a bug of Eclipse. It is all about the rt.jar along with the JDK (1.5 or 1.6). In Sun’s official JDK release, debug symbols are already packed into the rt.jar. But local variables’ debug information is not packed. Sun may consider that it is not OK to includes those local variables’ debugging information. That is the source of problem.
To solve this problem, you may need to upgrade to JDK 1.6. Download DEBUG jar file from
http://download.java.net/jdk6/binaries/
Double click it to install a new JDK. And configure your Eclipse to use the new JDK.
http://download.java.net/jdk6/binaries/
Double click it to install a new JDK. And configure your Eclipse to use the new JDK.
For JDK 1.5, recompiling rt.jar by yourself, or other information, please visit
http://forums.java.net/jive/thread.jspa?threadID=399&tstart=0
for a detailed discussion.
http://forums.java.net/jive/thread.jspa?threadID=399&tstart=0
for a detailed discussion.
这段描述只是针对rt.jar的:上面大概的意思是当rt.jar类库发布时,它们把调试标记打在了JAR包中,但局部变量的DEBUG信息并未打包。他们可能是出于“本地变量的调试信息包含在JAR包中并不好”的考虑,所以没有这么做,这就是问题的根源。
如果你想解决类似问题,你需要专门下载安装带这类信息的JDK......就是重装了JDK啦。
我觉得既然人家发布了,按一般的逻辑就认为它不会有BUG,如果你用了第三方类库,就认为你对它内部的运行方式已经了解,所以你不需要查找别人JAR包的BUG。如果真有BUG并且正好被你运行到了,那你就中奖喽。
----------------------------------------------------高兴的分界线--------------------------------------------------
1.把jdk中的src.zip解压缩
2.在elipse建立新的java项目
这时候会报很多错,不用鸟它就行。
3.将项目导出为jar格式
4.将新导出的jar包加入到Installed JRES
5.这个时候再调试就会有值了
0 0
- elipse 调试jdk时候变量不显示值以及解决办法
- myeclipse调试的时候鼠标放在变量上不显示变量的值
- jdk源码调试显示变量
- 调试程序成员变量不显示值
- elipse不显示代码行数
- delphi 调试的时候变量全部显示Inaccessible value的解决办法
- jdk不显示,右边空白,解决办法
- xcode调试程序有时不显示变量的值?
- VS调试Qt的时候只显示QString地址不显示值
- eclipse debug调试的时候不显示源码的解决方法
- xcode 调试的时候不显示 c 变量值
- Stm32f1 Keil5调试时候peripherals不显示的解决方法
- 设置Eclipse可以Debug模式调试JDK源码,并显示局部变量的值
- VS2010+Qt4调试时监视窗口部分类型变量只显示地址不显示值
- 调试JDK源码,无法追踪显示局部变量的解决方案
- 如何在eclipse中debug调试进入JDK源码及显示调试过程中的局部变量的值
- Eclipse调试JDK看不到变量的值
- 在调试c++程序时无法显示局部变量解决办法
- 下拉刷新及滚动到底部加载更多的Listview使用
- phoneGap 打包ios 过程以及遇到的各种困难
- 第13周项目5-字符串操作(1)-1
- 压缩感知中的数学知识:投影矩阵(projection matrix)
- Web开发基本准则-55实录-缓存策略
- elipse 调试jdk时候变量不显示值以及解决办法
- 【BZOJ2464】【中山市选2009】小明的游戏 最短路水过
- android中activity间动画跳转
- 第十三周项目1-2
- TortoiseSVN安装使用
- RealView MDK 使用
- 第十三周项目一(1) 数组大折腾(从前往后输出)
- NSSortDescriptor(数组排序)
- Android学习系列(29)--App调试的几个命令实践