Search code examples
javaeclipsejavadoc

Eclipse does not show Javadoc of OpenJDK 12


I installed OpenJDK 12 including the Javadoc and set the Javadoc URL in Eclipse to file:/usr/share/doc/java-openjdk/api/ which Eclipse validates. However when I for example press F2 over the String class, I get the message Note: This element has no attached source and the Javadoc could not be found in the attached Javadoc..

Could this be due to the modularity of the recent Java versions where java.lang.String resides under java.base, maybe Eclipse did not account for the new file paths? How can I fix this?

Versions

I use the newest versions available on Arch Linux at this time of both Java and Eclipse. The exact pacman package versions are:

extra/jdk-openjdk 12.0.1.u12-1 
extra/jre-openjdk 12.0.1.u12-1
extra/openjdk-doc 12.0.1.u12-1
community/eclipse-common 4.12-1
community/eclipse-java 4.12-1

P.S.: As requested, here my configuration. I don't have the Javadoc installed anymore but I show the new settings with source that work and also how I set it in the past with Javadoc that don't work. The "Invalid URL" warning was not there at the time as it did still exist! It validated correctly.

enter image description here


Solution

  • I am an arch linux user and I had the same problem. I have overcome this problem at the end of the day. I would like to note that if you are downloading jdk packages in linux, you should also download javadoc and source packages. After this, the src.zip folder will be created.

    sudo pacman -S jdk8-openjdk jdk11-openjdk jdk17-openjdk jdk-openjdk openjdk8-doc  openjdk11-doc openjdk17-doc openjdk21-doc openjdk8-src openjdk11-src openjdk17-src openjdk21-src