DrakeWalker
DrakeWalker

Reputation: 57

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

Upvotes: 5

Views: 7614

Answers (9)

Rand
Rand

Reputation: 141

For Netbeans on Linux-Mint and Java version 11 this work for me

sudo apt install openjdk-11-doc

sudo apt install openjdk-11-source

Upvotes: 1

Martin Meeser
Martin Meeser

Reputation: 2956

This solved the problem in my case (Ubuntu 19) immediately after a restart of NB:

sudo apt install openjdk-13-source

Upvotes: 0

Tombart
Tombart

Reputation: 32388

On Debian/Ubuntu:

apt install openjdk-11-doc

Then add go to:

Tools > Java Platforms > Javadoc tab > {your jdk 11 platform} > Add ZIP/Folder...:

/usr/share/doc/openjdk-11-jre-headless/api/java.base

Upvotes: 0

Marcelo D. Ré
Marcelo D. Ré

Reputation: 191

Well, after fighting a lot with NB 11 and OpenJDK 11 Javadoc, I fix it!

Platform: Ubuntu 18.04 Apache NetBeans IDE 11.0 (Build incubator-netbeans-release-404-on-20190319

I could not get to work the javadoc with any of the previous listed method. No HTTP, or local. Nothing work, or partially work. :( But, just in the last minute, when I already felt defeated and was about to jump to ECLIPSE, I think: what about OracleJDK 11?. It's suppose to be the same but... I downloaded the JDK11 from Oracle, uncompress it in a folder and add it as a Java Platform in NB and voila! It's work! It have nothing in Javadoc tab, but it recognize the src and everything is working. I use that platform only for typing since I build everything from console with gradle and the OpenJDK.

Upvotes: 0

user3366938
user3366938

Reputation: 1

I changed the jdk from 11 to 8, then configured the suitable Java 8 doc folder. This solved the problem. You have to change the project too.

Upvotes: 0

user7338252
user7338252

Reputation:

I struggled with this same issue using Apache Netbeans 9 and JDK 11 and this worked for me. If you need the swing components you have to add java.desktop as well. Also, you must have the trailing / for the online resource to work. You think they would check for that and add it if it doesn't exist.

online resource

https://docs.oracle.com/en/java/javase/11/docs/api/java.base/ https://docs.oracle.com/en/java/javase/11/docs/api/java.desktop/

local resource unzipped in Ubuntu /opt/jdk/ folder

/opt/jdk/jdk-11.0.1_doc-all/docs/api/java.base

/opt/jdk/jdk-11.0.1_doc-all/docs/api/java.desktop

Upvotes: 2

Erv
Erv

Reputation: 31

I had the exact same problem with Apache Netbeans 9 and JDK 11. Whatever I did, I could not see Javadoc results in Netbeans. I did succeed in the end. The steps I undertook:

  • I downloaded the jdk-11.0.1_doc-all.zip file.
  • The downloaded file I saved in C:\Program Files\Java\jdk-11.0.1\docs
  • In Netbeans under Tools -> Java Platform, under tab "Javadoc", I added the location of the folder C:\Program Files\Java\jdk-11.0.1\docs

The above steps did not help me, but after I restarted Netbeans64 with "Run as Administrator", it worked like a charm. Maybe something to do with security settings?

Upvotes: 3

skomisa
skomisa

Reputation: 17343

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

Upvotes: 1

Manfred Steiner
Manfred Steiner

Reputation: 1295

The problem is caused by missing the java.base/ on the end of the locator.

java.base, starting with Java 9, is the definition of the foundational APIs of the Java SE platform.

Using https://docs.oracle.com/en/java/javase/11/docs/api/ as URL resource will fail.
Using https://docs.oracle.com/en/java/javase/11/docs/api/java.base/ as URL resource will work.

Same issue for file resources. Add java.base/ at the end of the former file locator and it works.

Upvotes: 10

Related Questions