-2

Eclipse Oxygen.2 (4.7.2) fails to load standard javadoc when I select my JRE 9 install as default JRE.

Is that a bug?

When I switch back to JRE 8 it works.

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).

That's why I expect the Javadoc to display even with a JRE.

Now when I hover over a standard Java class, say java.io.IOException or java.lang.String for example:

  • with JRE9 the Javadoc is not found in the tooltip
  • with JDK9 it is found, but:
    • 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
    • if I click a link in the tooltip, e.g. 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]
  • 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/...)

So there are at least three problems:

  • How come my tooltip doesn't work with 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?
    • [ANSWERED] from the source code if any. So I attached [jdk9_path]/lib/src.zip as Source Location in my JRE9 and it works.
  • How come Eclipe is looking for jrt-fs.jar\java.base, which does not exist?
  • How come JDK9 & JRE9 come with an incorrect Javadoc Location (http://download.java.net/java/jdk9/docs/api/)?
Bsquare ℬℬ
  • 4,423
  • 11
  • 24
  • 44
pHneutre
  • 1,091
  • 3
  • 12
  • 29
  • 1
    Possible duplicate of [How do I add the Java API documentation to Eclipse?](https://stackoverflow.com/questions/4600172/how-do-i-add-the-java-api-documentation-to-eclipse) – chb Feb 28 '18 at 04:09
  • The JRE does not include the javadoc tool or API, are you sure this worked with JRE 8? Maybe it is actually using JDK 8. – Alan Bateman Feb 28 '18 at 07:13

1 Answers1

0

JREs are the bare runtimes, they do not contain the compiler, packaging tools, sources, or documentation. The easiest solution is often to use a JDK instead.

nitind
  • 19,089
  • 4
  • 34
  • 43