本文介绍了如何使用Eclipse检查调试符号状态?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

限时删除!!

在讨论另一个问题我问,@Aaron Digulla指出以下内容:

文件 src.zip 存在于我,但我仍然无法访问 JTable的来源

a)我使用的是Eclipse,为什么不使用SDK? / p>

b)如何知道我的SDK是否包含调试符号?如果没有,我如何添加它们?



c)如何检查Eclipse是否告诉 java 删除调试符号?



对于这些平淡的问题抱歉,但我觉得我完全不了解Java开发过程。

$ b $ a)Eclipse自带的Java编译器,因此如果您使用的是Java运行时环境,则不会遇到许多问题,除了附加功能像jarsigner,可能还缺少JRE源代码。验证您的安装的最佳方法是通过您的软件包管理器;但是,如果您通过其他方式安装,仔细的目录观察通常可以区分两者(见下文)。



b)JRE库通常在没有调试符号存在的情况下编译。 SDK库通常拥有它们。通过使用打开调试端口的命令行选项启动JVM来完成Java调试。 SDK通过该端口与JVM请求断点。稍后,如果您决定执行JVM,它也会通过此端口发送step / jump / rewind调试命令。 调试符号实际上是JVM字节码表,它引用了源代码在一个特定的字节码指令开始生效。这允许调试器将运行的字节码与原始源代码中的行号相关联。



c)通过(从菜单)验证它 - 窗口 - >首选项(在选择器上列)展开Java,展开Java下的构建路径,并选择ClassPath变量。您将看到一些变量,其中包括一个称为JRE_SRC的变量,它们应该指向包含公共面向JRE库源代码的src.zip文件。同时验证JRE_LIB是一个好主意。



JDK主目录通常包含一个bin子目录和jre子目录,所以如果你只看到一个bin子目录,那么你在JRE主目录中的几率是很好的。有了这个知识,希望你能够弄清楚。


While discussing another question I asked, @Aaron Digulla pointed out the following:

The file src.zip is present for me, but I still can't access the source of JTable like @Aaron said. What could be the problem? How can I solve this with Eclipse?

a) I'm using Eclipse, why shouldn't I being using SDK?

b) How do I know if my SDK contains debug symbols? And if it doesn't, how can I add them?

c) How can I check if Eclipse is telling java to strip debug symbols?

Sorry for these banal questions, but I feel like I don't fully understand the Java development process.

解决方案

a) Eclipse comes with it's own Java compiler, so if you are using the Java Runtime Environment, you won't run into many issues, except that extras like jarsigner and possibly the JRE source code may be missing. The best way to verify your installation is through your package manager; however, if you installed by some other means, careful directory observation can usually differentiate the two (see below).

b) JRE libraries are typically compiled without debugging symbols present. SDK libraries typically have them. Java debugging is done by starting the JVM with command line options which open a debugging port. The SDK talks to the JVM requesting breakpoints be set through this port. Later if you decide to step the JVM, it also sends the step / jump / rewind debugging commands through this port. The "debugging" symbols are actually JVM bytecode tables, which reference which line of source code is in effect starting at a particular bytecode instruction. This allows debuggers to associate the running bytecodes with line numbers in the original source code.

c) Verify it by (from the menu) Window->Preferences (on the selector column) expand "Java", expand "Build Path" under "Java", and select "ClassPath variables". You will see a few variables, including one called "JRE_SRC", which should point to the src.zip file containing the public facing JRE library source code. It is a good idea to verify JRE_LIB at the same time.

A JDK home directory typically contains a "bin" sub-directory and a "jre" sub-directory, so if you only see a "bin" sub-directory, odds are good you are in a JRE home directory. With this knowledge, hopefully you'll be able to figure the rest out.

这篇关于如何使用Eclipse检查调试符号状态?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

1403页,肝出来的..

09-07 03:13