Javadoc 在 Eclipse 中不可用

发布于 2024-12-26 09:55:06 字数 815 浏览 3 评论 0原文

我正在使用 Eclipse IDE for Java Developers

版本:Helios Service Release 2 构建 ID:20110218-0911

我有一个与此类似的问题 stackoverflow 问题

在阅读其他问题时,我发现这个错误

该元素没有附加源代码,并且在附加的 Javadoc 中找不到 Javadoc

这是由于 Eclipse 无法找到 javadoc 文件造成的。

我查了一下,我在c程序文件/java位置都有JDK和JRE。 我在 C:\Program Files\Java\jdk1.6.0_30 处有 src.zip 文件,在 C:/Program Files/Java/jre6/lib/rt.jar 处有 src lib 文件,

这两个路径都在类路径变量中设置。

安装的 JRE 指的是 C:\Program Files\Java\jre6,所有 JRE 系统库的 javadoc 位置设置为 http://java.sun.com/javase/6/docs/api/

但我仍然无法看到鼠标悬停在任何 java 或 android 方法上的 javadoc

你有吗关于如何获得这个的任何建议 在职的?

I am using Eclipse IDE for Java Developers

Version: Helios Service Release 2
Build id: 20110218-0911

I have a problem similar to this stackoverflow question

On reading other questions, I have found that the error

This element has no attached source and the Javadoc could not be found in the attached Javadoc

is caused by Eclipse not being able to locate the javadoc file.

I checked, I have both JDK and JRE in c program files / java location.
I have src.zip file at C:\Program Files\Java\jdk1.6.0_30, I have src lib file at C:/Program Files/Java/jre6/lib/rt.jar

Both these paths are set in classpath variables.

Installed JRE is referring to C:\Program Files\Java\jre6 and javadoc location for all JRE system libraries is set to http://java.sun.com/javase/6/docs/api/

But still I am not able to see the javadoc on mouse hover of any java or android methods

Do you have any advice on how to get this working?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

战皆罪 2025-01-02 09:55:06

在此处输入图像描述

在 Eclipse 中,转到“窗口”、“首选项”,然后导航至 javadoc 选项或在显示“的位置键入 javadoc”输入过滤文本'。
检查是否选中了“处理 Javadoc 注释”选项。
在您选中/取消选中该选项后,它可能会要求您对项目进行完全重建。

enter image description here

In Eclipse, go to Window, Preferences, and navigate to the javadoc options or type javadoc where it says 'type filter text'.
Check if the options 'Process Javadoc comments' is checked.
It may ask you to do a full rebuild of your projects after you check/uncheck that option.

千仐 2025-01-02 09:55:06

您似乎正在 Eclipse 中开发 Android 应用程序。
安装 ADT 插件后,您不再使用标准 Java JDK,而是使用 Android 版本。

要解决此问题,您需要使用 Android SDK 和 AVD Manager 安装“Android SDK 文档”包。
这会将文档文件夹放入适合 eclipse + ADT 插件的 android sdk 位置,以向您提供 javadoc 帮助弹出窗口。

You seem to be developing an Android App in Eclipse.
When you have the ADT plugins installed you are no longer using the standard Java JDKs, but rather the android versions.

To fix this you'll want to Install "Documentation for Android SDK" package using Android SDK and AVD Manager.
This will place the documentation folder into the android sdk location suitable for eclipse + the ADT plugins to supply you javadoc help popups.

小嗲 2025-01-02 09:55:06

Eclipse Mars (4.5.1) 也有同样的问题。我需要手动将 rt.jar 的源附件分配给 src.zip:

  • 导航到项目的属性页:Project >属性> Java 构建路径 > JRE系统库> rt.jar >来源附件
  • 单击编辑...,选择外部位置并在此处输入src.zip的路径。

Had the same problem with Eclipse Mars (4.5.1). I needed to assign the Source attachment of rt.jar to the src.zip manually:

  • Navigate to your project's property page: Project > Properties > Java Build Path > JRE System Library > rt.jar > Source attachment.
  • Click Edit..., choose External location and put the path to src.zip here.
看海 2025-01-02 09:55:06
  1. 通过 Ctrl+单击方法导航到该方法。新的
    选项卡/窗口将打开,并显示文本“找不到源”和按钮
    “附加源”在其中。
  2. 单击按钮“附加源”将弹出新窗口。
  3. 单击“外部文件夹”按钮。
  4. 单击“外部文件”按钮
  5. 如果您使用的是默认安装设置的 Windows,则文件夹路径为 C:\Program Files\Java\jre1.8.0_151\lib然后单击 rt.zip 文件并单击“打开”
  6. 单击按钮“确定”

希望这能回答您的问题。

  1. Navigate to that method by Ctrl+Click on the method. The new
    tab/window will opened with text "Source not found" and button
    "Attach Source" in it.
  2. Click the button "Attach Source" New window pops up.
  3. Click the button "External Folder".
  4. Click the button "External File"
  5. If you are on Windows with default installation settings, then the folder path is C:\Program Files\Java\jre1.8.0_151\lib and then click on rt.zip file and click on "Open".
  6. Click the button "OK"

Hope this answers your question.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文