java - 无法检查本地声明的变量

标签 java eclipse debugging

有时当我在 Eclipse 中调试代码时,虽然我可以毫无困难地查看和检查类成员变量,但我无法检查在函数中本地声明的变量的值。顺便说一句,当前函数的任何参数都会丢失它们的“真实”名称,而是会在“变量”窗口中看到它们的值,如 arg0、arg1、arg2 等,但至少这些值是可见的。

目前这种情况与核心 JDK 中定义的类有关。我已验证已安装且当前的 JRE 是 JDK。

有人能解释一下这种行为吗?

最佳答案

显然,answer是:

the rt.jar that ships with the JDK (where the core Java classes live) is not compiled with full debug information included in the .class files, so the debugger does not have local variable info.

Unfortunately, this is not something that Eclipse can do anything about - all debuggers will have the same problem with JDK core classes.

release notes of Eclipse 3.4状态:

Missing debug attributes
The debugger requires that class files be compiled with debug attributes if it is to be able to display line numbers and local variables. Quite often, class libraries (for example, "rt.jar") are compiled without complete debug attributes, and thus local variables and method arguments for those classes are not visible in the debugger.

关于java - 无法检查本地声明的变量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/271521/

相关文章:

java - 我在使用此代码将 csv 转换为 json 架构时收到此错误

java - Java中有没有一种方法可以获取BitSet中打开的位数?

java - 使用不包含类文件的java库

android - 我有两个 R 生成的类。我该如何解决?

visual-studio-2010 - 使用网站附加到VS2010 Express中的过程。是否可以?

java - Scala编译时错误: No implicits found for parameter evidence$2: BodyWritable[Map[String,对象]]

java - 构建maven项目时No class def found错误

java - 服务器端 Java 应用程序代码无法编译 - 为什么?

ios - ionic cordova run ios - 导出失败,代码为 65

swift - 我的 tableview 突然停止滚动