如何将 Java API 文档添加到 Eclipse? [英] How do I add the Java API documentation to Eclipse?

查看:34
本文介绍了如何将 Java API 文档添加到 Eclipse?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从 http://www 下载了 Java API 文档.oracle.com/technetwork/java/javase/downloads/index.html#docs 并据称使用

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

Window->Preferences->Java->InstalledJREs->编辑->选择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,您应该附上可用的源 这里.

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屋!

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