问题描述
我终生无法将 java 源代码附加到 eclipse 中,以便我可以看到该语言的内部工作原理.甚至不是像 String 类这样简单的东西.
I cannot for the life of me attach the java source code to eclipse so I can see the inner workings of the language. Not even something as simple as the String Class.
当我运行 java -version 这就是我所拥有的:
when I run java -version this is what I have:
java version "1.6.0_14"
Java(TM) SE Runtime Environment (build 1.6.0_14-b08)
Java HotSpot(TM) Client VM (build 14.0-b16, mixed mode, sharing)
我正在从以下位置下载 java 源:http://download.java.net/jdk6/source/
I am downloading the java souce from:http://download.java.net/jdk6/source/
在 eclipse 中,当我附加它时它说:
And in eclipse when I attach it It says:
The JAR file "C:Program FilesJavajre6jdk-6u14-fcs-src-b08-jrl-21_may_2009.jar"
has no source attachment.
我做错了什么?
推荐答案
通常情况下,如果您安装了 JDK6u14,eclipse 应该会检测到它并在其已安装的 JRE"列表中自动声明.
Normally, if you have installed the JDK6u14, eclipse should detect it and declare it automatically in its "installed JRE" list.
如果没有,您可以通过Windows/Preferences"添加该 JDK:Java >已安装的 JRE
:
If not, you can add that JDK through "Windows/Preferences": Java > Installed JREs
:
只需指向 JDK 安装的根目录:它应该包含 JDK 的源代码 (src.zip
),自动检测并附加到 rt.jar
日食.
Just point to the root directory of your JDK installation: it should include the sources of the JDK (src.zip
), automatically detected and attached to rt.jar
by eclipse.
这篇关于附上 Java 源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!