附加Java源代码 [英] Attach the Java Source Code

查看:240
本文介绍了附加Java源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不能为我的生活,将java源代码附加到eclipse,所以我可以看到语言的内部工作。甚至没有像String类一样简单。



当我运行java -version这是我有的:

  java版本1.6.0_14
Java(TM)SE运行时环境(build 1.6.0_14-b08)
Java HotSpot(TM)客户端虚拟机14.0-b16,混合模式,共享)

我从下载java souce:
http://download.java.net/jdk6/source/



在eclipse中附加它说:

  JAR文件C:\\ \\ Program Files\Java\jre6\jdk-6u14-fcs-src-b08-jrl-21_may_2009.jar
没有源附件。

我做错了什么?

解决方案

通常情况下,如果您安装了JDK6u14,eclipse应该检测它,并在安装的JRE列表中自动声明。



如果没有,您可以通过Windows /首选项添加该JDK: Java>安装的JRE



只需指向JDK安装的根目录:它应该包含JDK的源代码( src.zip ),通过eclipse自动检测并附加到 rt.jar




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.

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)

I am downloading the java souce from: http://download.java.net/jdk6/source/

And in eclipse when I attach it It says:

The JAR file "C:\Program Files\Java\jre6\jdk-6u14-fcs-src-b08-jrl-21_may_2009.jar" 
has no source attachment.

What am I doing wrong?

解决方案

Normally, if you have installed the JDK6u14, eclipse should detect it and declare it automatically in its "installed JRE" list.

If not, you can add that JDK through "Windows/Preferences": Java > Installed JREs:

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源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆