如何解决“该元素没有附加源并且在附加Javadoc中找不到Javadoc”?

发布于 2024-11-09 12:04:24 字数 72 浏览 0 评论 0原文

我不知道执行此操作的确切方法。我想要一个方法,而不是针对单个项目,适用于 Eclipse 中的所有项目。请告诉我如何解决这个问题。

I don't get the exact method to do this. I want a method not for a single project for all projects in eclipse. Please tell me how to solve this problem.

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

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

发布评论

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

评论(9

宛菡 2024-11-16 12:04:24

这是针对 Eclipse 中类路径上的一个 jar,其中

  1. 附加了一个 Eclipse 由于某种原因不喜欢的 javadoc zip。

  2. 未附加有效的源 jar。

最简单的方法是右键单击有问题的 jar(在引用的 jar 中,而不是物理 jar 中)并选择“首选项”->“选项”。 Javadoc。这里给出正确的 javadoc 的正确位置(zip/URL)。请记住使用“验证”按钮以确保其设置正确。

This is for a jar on your classpath in Eclipse, where you have

  1. attached a javadoc zip which Eclipse for some reason dislikes.

  2. NOT attached a valid source jar.

The easiest way is to right-click the jar in question (in the referenced jars, not the physical jar) and choose Preferences -> Javadoc. Here give a correct location (zip/URL) to the correct javadoc. Remember to use the "Validate" button to ensure that it is correctly set up.

半窗疏影 2024-11-16 12:04:24

Akki的问题也困扰了我太久。但修复非常简单。

如果您使用 Eclipse (Neon),并且

如果您有 Maven(强烈推荐)和 Eclipse 插件来处理它,并且

如果您的项目一个 Maven 项目(它可以转换为一个 * *),

然后您可以轻松地将 Javadoc 添加到您的所有 jar 依赖项中(如果您还使用 Spring Boot,则可能有大约 75 个!)执行以下操作:

  • 右键单击您的项目(在项目资源管理器中),
  • 将鼠标悬停在“Maven”上以获取子菜单,然后
  • 选择“下载 JavaDocs”。

您应该在右下角看到一个状态栏,上面写着“正在下载源代码和 javadoc”以及一个进度栏。

** 要 Maven 化您的项目:

  • 在项目资源管理器中右键单击该项目,
  • 将鼠标悬停在“配置”上以获取子菜单,然后
  • 选择“转换为 Maven 项目”。

Akki's problem also plagued me for much too long. But the fix is super easy.

If you're using Eclipse (Neon), and

If you have Maven (highly recommended) with the Eclipse plugin to handle it, and

If your project is a Maven project (it can be converted into one **),

Then you can easily add Javadocs to all your jar dependencies at once (if you're also using Spring Boot, there may be about 75 of them!) by doing the following:

  • Right click on your project (in the Project Explorer),
  • Hover over "Maven" to get a submenu, and
  • Select "Download JavaDocs".

You should see in the lowest right hand corner a status bar that says "downloading sources and javadocs" and a progress bar.

** To mavenize your project:

  • Right click on it in the Project Explorer,
  • Hover over "Configure" to get a submenu, and
  • Select "Convert to Maven Project".
や三分注定 2024-11-16 12:04:24

在我将 Android 文件从一台 PC 移动到另一台新 PC 后,我就发生了这种情况:我只是将文件夹从 P:\Android\ 复制到 C:\Android\

要修复错误(使用 Eclipse),请右键单击库(在我的例子中 android.jar) 在你的项目中。单击“属性”,单击“Javadoc 位置”,然后修复 Javadoc 位置路径。

例如,我将其从“file:/P:/Android/android-sdk-windows/docs/reference”更改为“file:/C:/Android/android-sdk-windows/docs/reference”,

然后单击“验证” ”。然后点击“应用”。然后单击“确定”,

现在将鼠标悬停在方法或常量上,再次为我提供 API 信息:-)

This happened to me after I moved my Android files from one PC to a new PC: I simply copied the folder from P:\Android\ to C:\Android\

To fix the error (using Eclipse), right-click the library (in my case android.jar) in your project. Click "Properties", click "Javadoc Location", and fix the Javadoc location path.

For example, I changed it from "file:/P:/Android/android-sdk-windows/docs/reference" to "file:/C:/Android/android-sdk-windows/docs/reference"

Then click "Validate". Then click "Apply". Then click "OK"

now hovering over a method or constant gives me the API info again :-)

匿名。 2024-11-16 12:04:24

假设您使用 Eclipse 作为 IDE,该语句(在您的问题标题中提供)意味着 IDE 找不到 javadoc 注释来显示方法/类/属性描述(通常在将鼠标悬停在类/方法/属性)。要解决此问题,您需要附加包含 javadoc 注释的 jar 或 zip。这通常是指定类的源代码(因为它包含注释,如果程序员提供了注释),IDE 将从其中提取 javadoc 注释并适当地显示它。

希望这有帮助。

Assuming you're using Eclipse as an IDE, the statement (provided in your question title) means that the IDE cannot find a javadoc comment to display the method/class/attribute description (usually shown when hovering a class/method/attribute). To fix this, you need to attach a jar or zip that contains the javadoc comment. This is usually a source code for a specified class (as it contains comments, if the programmer provided comments) and the IDE will extract the javadoc comments out of it and display it appropriately.

Hope this helps.

深海不蓝 2024-11-16 12:04:24

当我升级到 Eclipse Photon 版本时,这个问题也发生在我身上。使用以下流程手动附加 Javadoc。

转到 Eclipse >>窗口>>首选项>> Java>>安装的 JRE>>选择“JRE”并编辑>>选择“C:\Program Files\java...\lib\jrt-fs.jar”>>选择“源附件”和源附件... >>>选择外部位置>>转到“src”路径,如“C:/Program Files/Java/jdk-10.0.1/lib/src.zip”>>好的>>完成>>应用并关闭。

This problem happened to me also when I upgrade to Eclipse Photon version. Use this following flow to attach Javadoc manually.

Go to Eclipse >> Window >> Preferences >> Java >> Installed JREs >> Select "JRE" and Edit >> Choose "C:\Program Files\java...\lib\jrt-fs.jar" >> Choose "Source attachment" and Source attachment... >> Choose External location >> Go to the path of "src" like "C:/Program Files/Java/jdk-10.0.1/lib/src.zip" >> Ok >> Finish >> Apply and Close.

世态炎凉 2024-11-16 12:04:24

我知道这是一个很晚的答案,但是如果有人使用 gradle 项目,这将会有所帮助。

更改您的 build.gradle 以包含以下内容:-

apply plugin: 'java'
apply plugin: 'eclipse'

eclipse {
    classpath {
        downloadJavadoc = true
        downloadSources = true
    }
}

这将添加 java 源代码和 javadoc。

如果这仍然不起作用,则右键单击项目>构建路径>配置构建路径>顺序和导出>并将 Web 应用程序库置于底部 然后关闭项目并重新打开它

I know this is a very late answer, but this will help if anyone is using a gradle project.

change your build.gradle to include the following:-

apply plugin: 'java'
apply plugin: 'eclipse'

eclipse {
    classpath {
        downloadJavadoc = true
        downloadSources = true
    }
}

This will add both java source and javadoc.

If this still doesnot work then right click on the Project>Build PAth>Configure Build Path>order and Export > and bring Web App libraries to the bottom Then Close the project and reopen it

椵侞 2024-11-16 12:04:24

在 OSX 10.7.5 上使用 Eclipse 4.2.2,将库放入“引用库”后,我必须右键单击它 >构建路径>配置构建路径>转到“订单和导出”选项卡,然后突出显示我想要的库,并使用“向上”按钮将其移至顶部。我没有注意到选中或未选中复选框有任何区别。

这就是它对我有用的原因。

Using Eclipse 4.2.2 on OSX 10.7.5, after I got the lib into "referenced libs", I had to then right click it > Build Path > Configure Build Path > go to Order and Export tab, then highlight the lib I want and move it up to the top with the "up" button. I didn't notice any difference with the checkbox checked or unchecked.

That's what got it working for me.

红尘作伴 2024-11-16 12:04:24

另外,在 UI 中执行其中一项操作后,您将看到 .classpath 文件已更改 - 该 jar 现在具有 sourcepath 属性。

退出 eclipse 并手动编辑其余部分可能会更容易。将 foo-source jar 文件作为单独的 jar 删除,并将它们添加为每个 classpathentry 元素上的 sourcepath 属性。

Also, after doing one of these in the UI, you'll see your .classpath file has changed- that jar now has a sourcepath attribute.

It's probably easier to quit eclipse and edit the rest by hand. Remove the foo-source jar files as separate jars and add them as sourcepath attributes on each classpathentry element.

装纯掩盖桑 2024-11-16 12:04:24

要解决所有项目的此问题,最好的方法是创建一个用户库并将所有外部 JAR 导入该库。然后,对于每个 JAR,将 javadoc URL 添加到 Javadoc 位置字段中。
因此,每当您需要在构建路径下导入 JAR 时,请始终使用用户库。这样您就已经配置了 javadoc 位置。

To Solve this issue for all projects, the best way is to create a user library and import all your external JARs into that library. Then for each JAR add the javadoc URL into Javadoc location field.
So this way whenever you need to import the JARs under build path, always use user library. so you will have javadoc location already configured.

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