Search code examples
javanetbeansjavadocjava-10

Javadocs are not appearing on Apache netbeans for java 10


Netbeans Version: Apache NetBeans 9.0

Java version: Java 10

No matter what I do, I can't get the javadocs to appear and display method details on anything.

I've gone into the Java Platforms and into the Javadocs, I've set the Zip, unzipped and URL for the javadocs, but it just wont work...

Java Doc: jdk-10.0.1_doc-all

URL: https://docs.oracle.com/javase/10/docs/api

I couldn't find any answers anywhere, they all mentioned adding the docs like I already tried.

Edit Reply: Even with adding the 'java.base/' it still doesn't work. I even completely deleted netbeans and all appdata. Re-downloaded it, installed JDK11, and tried the docs again...but the SAME thing. Am I going insane??

enter image description here enter image description here


Solution

  • You can link to the JDK help documentation in NetBeans using a URL or the file location of the zipped documentation. Both approaches work for me for Java 10 using Apache NetBeans 9.0 RC1:

    javadocLinks

    Obviously you only need one of those entries. Both are shown in the screen shot above purely for addressing your question, and both can be set during the addition of the JDK 10 platform, or at a later time.

    For using the file location for JDK Javadocs:

    • Download the Javadoc files to some arbitrary directory.
    • Tools > Java Platforms > Javadoc tab > {your jdk 10 platform} > Add ZIP/folder...
    • Navigate to the downloaded Javadoc file, which was jdk-10-ea+42_doc-all.zip in my case.

    For using the URL for JDK Javadocs:

    If you still have problems:

    • Make sure that you are using the latest build of NetBeans 9.0 RC1.
    • Use the specific URL and Javadoc file that I used, since both approaches definitely work for me.
    • If things still aren't working delete the JDK 10 platform, restart NetBeans and try again. (I have no specific reason for suggesting that, but it will only take two minutes to try.)

    My personal preference is to use a local zip file rather than a URL since it is faster and you do not need internet access. Here's a screen shot showing the Javadoc for Optional.orElseThrow() which was new in JDK10:

    orElseThrow()


    Updated on 11/8/2018 to address the use of OpenJDK 10 with NB 9.0:

    • I deleted all Java Platforms except JDK 1.8 (Default).
    • I closed NetBeans and deleted the cache and user directories as shown in Help > About.
    • I restarted NetBeans and created a trivial Java application that called Optional.orElseThrow() which was added in JDK 10. As expected the project would not compile using the platform JDK 1.8 (Default).
    • I added OpenJDK 10 as a Java platform, but did not specify any Javadoc.

      AddPlatform NoJavaDoc

    • I updated the project to use OpenJDK 10 instead of JDK 1.8 (Default). Help for Java 10 methods worked fine without specifying any Javadoc location!

      HelpForOpenJDK10