如何将Java API文档添加到Eclipse? [英] How do I add the Java API documentation to Eclipse?
问题描述
我已经从 http:// www .oracle.com / technetwork / java / javase / downloads / index.html#docs ,并据此将其附加到Eclipse使用
I have downloaded Java API documentation from http://www.oracle.com/technetwork/java/javase/downloads/index.html#docs and have supposedly attached it to Eclipse using the
窗口 - >首选项 - > Java->安装
JREs->编辑 - >选择rt.jar - > Javadoc
位置
Window->Preferences->Java->Installed JREs->Edit->"Select rt.jar"->Javadoc Location
该位置已被接受,验证就可以了。然而,对于我的生活,当我将鼠标悬停在一个项目(例如在ArrayList的声明中)时,我不能让Eclipse在工具提示中显示Javadoc。我也重新启动了Eclipse,试图让它工作
And the location has been accepted and "Validates" just fine. However, for the life of me, I can't get Eclipse to show the Javadocs in the tooltip whene I hover over an item (for example in the declaration of an ArrayList). I have also restarted Eclipse in attempts to get it to work
我做错了什么?
推荐答案
Eclipse不会从javadoc位置拉出工具提示。如果您在浏览器中打开,则只使用javadoc位置来预览链接,您需要下载并附加JDK的源以获取工具提示。对于JRE下的所有JAR,您应该为javadoc位置提供以下内容: http:/ /java.sun.com/javase/6/docs/api/ 。对于resources.jar,rt.jar,jsse.jar,jce.jar和charsets.jar,您应该附加源代码 here 。
Eclipse doesn't pull the tooltips from the javadoc location. It only uses the javadoc location to prepend to the link if you say open in browser, you need to download and attach the source for the JDK in order to get the tooltips. For all the JARs under the JRE you should have the following for the javadoc location: http://java.sun.com/javase/6/docs/api/. For resources.jar, rt.jar, jsse.jar, jce.jar and charsets.jar you should attach the source available here.
这篇关于如何将Java API文档添加到Eclipse?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!