1

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

Konrad Höffner
  • 11,100
  • 16
  • 60
  • 118
  • What version of Eclipse are you using? Is that the latest? – Basil Bourque Jul 17 '19 at 12:13
  • @basilbourque: 4.12.1, the newest version. – Konrad Höffner Jul 17 '19 at 12:15
  • Post such details as edits to your Question, not as Comments. – Basil Bourque Jul 17 '19 at 12:16
  • The current version [here](https://www.eclipse.org/downloads/packages/) appears to be Eclipse IDE 2019-06 R. – Basil Bourque Jul 17 '19 at 12:20
  • Have you tried manually selecting the source JAR https://stackoverflow.com/a/6106275/1602555? – Karol Dowbecki Jul 17 '19 at 12:21
  • @BasilBourque: Eclipse seems to have two version schemes, where 2019-06 and 4.12 are the same. – Konrad Höffner Jul 17 '19 at 12:21
  • @KarolDowbecki: After installing openjdk-src-12.0.1.u12-1 and pointing Eclipse to `/usr/lib/jvm/java-12-openjdk/lib/src.zip` it works! However I still wonder why it doesn't work with the Javadoc. – Konrad Höffner Jul 17 '19 at 12:26
  • @KonradHöffner The Eclipse Java IDE 2019-06 is built of the Eclipse Platform and the Java Development Tools (JDT) 4.12, EGit/JGit 5.4, m2e 1.12, etc. Please show what you have exactly configured in _Window > Preferences: Java > Installed JREs_. – howlger Jul 17 '19 at 14:08
  • @howlger: Unfortunately I don't have the Javadoc installed anymore as I use the source now so I can't create an accurate screenshot anymore but I will show as it is now. – Konrad Höffner Jul 17 '19 at 14:18
  • Eclipse doesn't validate your Javadoc location when you specify it as a URL. Was it even correct--it's not in the downloaded OpenJDK 12 build I have? – nitind Jul 17 '19 at 15:12
  • I used the browse button to select the folder which produced that url. It wasn't included in the open jdk but in its own package. – Konrad Höffner Jul 17 '19 at 15:50

0 Answers0