简体   繁体   English

Eclipse 中缺少 JRE 9 的 Javadoc

[英]Missing Javadoc in Eclipse for JRE 9

Eclipse Oxygen.2 (4.7.2) fails to load standard javadoc when I select my JRE 9 install as default JRE.当我选择我的JRE 9安装作为默认 JRE 时, Eclipse Oxygen.2 (4.7.2)无法加载标准 javadoc。

Is that a bug?这是一个错误吗?

When I switch back to JRE 8 it works.当我切换回JRE 8 时,它可以工作。

EDIT编辑

So, I was a bit short on that one, let me explain.所以,我对那个有点短,让我解释一下。 When I select a JRE for Eclipse (Preferences > Java > Installed JREs), should it be a JRE9, a JDK9, a JRE8 or a JDK8 location, when I Edit it, I can see in the jrt-fs.jar (9) or in each separated jar including rt.jar (8) a Source attachment location (empty for JRE which is normal) and Javadoc location (official HTTP URL).当我为 Eclipse (Preferences > Java > Installed JREs) 选择 JRE 时,它应该是 JRE9、JDK9、JRE8 还是 JDK8 位置,当我Edit它时,我可以在 jrt-fs.jar (9) 中看到或在每个单独的 jar 中,包括 rt.jar (8) Source attachment位置(对于 JRE 为空,这是正常的)和Javadoc location (官方 HTTP URL)。

That's why I expect the Javadoc to display even with a JRE.这就是为什么我希望即使使用 JRE 也能显示 Javadoc。

Now when I hover over a standard Java class, say java.io.IOException or java.lang.String for example:现在,当我将鼠标悬停在标准 Java 类上时,例如说java.io.IOExceptionjava.lang.String

  • with JRE9 the Javadoc is not found in the tooltip使用 JRE9 在工具提示中找不到 Javadoc
  • with JDK9 it is found, but:使用 JDK9 可以找到,但是:
    • if I click "open attached Javadoc in browser" I get an Oracle NotFound error page looking for http://download.java.net/java/jdk9/docs/api/java/io/IOException.html which is the URL in the Javadoc Location of JRE9 & JDK9如果我单击“在浏览器中打开附加的 Javadoc”,我会得到一个 Oracle NotFound 错误页面,寻找http://download.java.net/java/jdk9/docs/api/java/io/IOException.html中的 URL JRE9 和 JDK9 的 Javadoc 位置
    • if I click a link in the tooltip, eg java.io.InputStream , I get an Eclipse error: Exception:org.eclipse.jdt.core.JavaModelException: I/O exception which is Caused by: java.io.IOException: null , followed by a Java Model Exception: Java Model Status [C:\\Program Files\\Java\\jdk-9.0.4\\lib\\jrt-fs.jar\\java.base is not on its project's build path]如果我单击工具提示中的链接,例如java.io.InputStream ,则会收到 Eclipse 错误: Exception:org.eclipse.jdt.core.JavaModelException: I/O exception which is Caused by: java.io.IOException: null ,后跟Java Model Exception: Java Model Status [C:\\Program Files\\Java\\jdk-9.0.4\\lib\\jrt-fs.jar\\java.base is not on its project's build path]
  • with JRE8 or JDK8 the Javadoc is found in the tooltip as well as in the attached Javadoc in browser ( docs.oracle.com/javase/8/... )对于 JRE8 或 JDK8,Javadoc 可以在工具提示中以及attached Javadoc in browser中的attached Javadoc in browserdocs.oracle.com/javase/8/...

So there are at least three problems:所以至少存在三个问题:

  • How come my tooltip doesn't work with JRE9?为什么我的工具提示不适用于 JRE9? The possible duplicate question's answer says that Eclipse doesn't pull the tooltips from the javadoc location , so where does it pull it from? 可能重复的问题的答案Eclipse doesn't pull the tooltips from the javadoc location ,那么它从哪里拉出来?
    • [ANSWERED] from the source code if any. [ANSWERED]来自源代码(如果有的话)。 So I attached [jdk9_path]/lib/src.zip as Source Location in my JRE9 and it works.所以我在我的 JRE9 中附加了[jdk9_path]/lib/src.zip作为Source Location并且它可以工作。
  • How come Eclipe is looking for jrt-fs.jar\\java.base , which does not exist?为什么 Eclipe 正在寻找不存在的jrt-fs.jar\\java.base
  • How come JDK9 & JRE9 come with an incorrect Javadoc Location ( http://download.java.net/java/jdk9/docs/api/ )?为什么 JDK9 和 JRE9 带有不正确的 Javadoc 位置 ( http://download.java.net/java/jdk9/docs/api/ )?

JREs are the bare runtimes, they do not contain the compiler, packaging tools, sources, or documentation . JRE是裸运行时,它们不包含编译器、打包工具、源代码或文档 The easiest solution is often to use a JDK instead.最简单的解决方案通常是使用JDK

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM