1

I'm running NB 11.2 with Oracle JDK 13.0.1+9 NB's Java Platform ->> Javadocs (tab) is empty (no entries).

When I type (NB editor) java.math. -or- java.nio. (examples), pop-open menus shows methods AND the full javadoc info for each method as expected.

But when I type java.sql. -or- java.rmi. (examples), I get the methods listed, BUT Javadoc shows just the package and class definition and a message ((THE MESSAGE)) that reads:

Javadoc not found. Either Javadoc documentation for this item does not exist or you have not added specified Javadoc in the Java Platform Manager or the Library Manager.

Here's a screenshot:

JavadocError

So I added this URL to the Java Platforms ->> Javadocs tab: https://docs.oracle.com/en/java/javase/13/docs/api/

No help...same problem.

So I added this URL Java Platforms ->> Javadocs tab: https://docs.oracle.com/en/java/javase/13/docs/api/java.sql/

Now, the results changed, but still wrong. I've lost THE MESSAGE, but the package and class def shows with all blank text afterwards.

If this isn't a bug in NB/Oracle URL, then it seems very poorly documented which is evidenced by the sheer number of questions asked on SO.

Also, I'd like to download the whole javadoc .zip file and use a file ref instead of a URL. Is this still possible?

skomisa
  • 16,436
  • 7
  • 61
  • 102
Bcwilmot
  • 51
  • 4
  • https://stackoverflow.com/questions/6986993/how-to-download-javadoc-to-read-offline/21676661 – Stephen C Nov 16 '19 at 01:23
  • See [Netbeans 11 Javadoc Not Appearing?](https://stackoverflow.com/q/56161666/2985643). It looks like you aren't the only one having this problem. – skomisa Nov 17 '19 at 04:16

1 Answers1

0

I'm running NB 11.1 with Oracle JDK 13.0.1+9...

That's a problem in itself. While it may appear to work, NetBeans 11.1 does not support the use of JDK 13. From the Product Manager for NetBeans: "Apache NetBeans 11.1 supports JDK 8 to JDK 12". Unfortunately I can't see this being explicitly stated anywhere on the Apache NetBeans web site.

So to successfully access Javadocs for JDK 13 in your applications:

Also, I'd like to download the whole javadoc .zip file and use a file ref instead of a URL. Is this still possible?

Yes:

  • You can download the JDK 13 API Javadoc file jdk-13.0.1_doc-all.zip from here.
  • There no need to unzip the downloaded file.
  • In NetBeans 11.2 open Tools > Java Platforms > select your JDK 13 platform entry.
  • Click the Javadoc tab then click Add Zip/Folder...
  • Navigate to the downloaded file jdk-13.0.1_doc-all.zip, select it, then click Add Zip/Folder...
  • An entry for it will be added in the Platfrom Javadoc list. Remove any https URLs you had added previously, so that it is the only Javadoc entry for JDK 13:

    javadocTab

Once you have done all that, Javadoc should work fine for your JDK 13 applications. Here's an example using java.rmi package which was not working for you:

rmiJavadoc

skomisa
  • 16,436
  • 7
  • 61
  • 102
  • Did as directed. Same exact problem still exists. NBs 11.2 and Javadocs tab same as shown above. Even after restart of NBs. Also checked the .zip file.....it seems to be good and don't believe its content is a problem. – Bcwilmot Nov 16 '19 at 02:12
  • OK. [1] Could you update your question with a screenshot showing what you get when you emulate what I did in my screenshot for `java.rmi.MarshallException` so everyone is clear on the nature of your problem. I just typed **java.rmi.** in some method, and pressed `CTL/space` to generate the Javadoc output. [2] Please check the NetBeans log (**View > IDE Log**), and update your question if there is anything of relevance in it. [3] Just FYI, I didn't need to restart NetBeans after setting the Javadoc location; it worked immediately. – skomisa Nov 16 '19 at 02:20
  • One other thing you could try is to replace the local *.zip entry for the Javadoc with the online URL instead (https://docs.oracle.com/en/java/javase/13/docs/api/) as given in your question. I just tried that and the Javadoc for `java.rmi.MarshallException` still worked fine. – skomisa Nov 16 '19 at 02:27
  • Okay. Here's my javadocs tab page. The .zip was tried by itself (and fails), so I added the URL. Still no happy. – Bcwilmot Nov 16 '19 at 04:52
  • This page is ![valid XHTML][checkmark]. [checkmark]: https://i.imgur.com/0mKyhx3.png "Posting images is too hard on SO." – Bcwilmot Nov 16 '19 at 05:09
  • This page is ![valid XHTML][checkmark]. [checkmark]: https://i.imgur.com/0mKyhx3.png "Posting images is too hard on SO."Just can't grok the SO mechanism to post an image. – Bcwilmot Nov 16 '19 at 05:15
  • And here is the actual editor failure of java.rmi.MarshalledObject. Again, cannot figure out how to post an image (in spite of RTFM help). find it at https://i.imgur.com/BMErgEL.png – Bcwilmot Nov 16 '19 at 05:17
  • I looked in log. Cannot assert there's an obvious problem, but quite uncertain. Tried to list it here by SO comment editor says it was too long. – Bcwilmot Nov 16 '19 at 05:20
  • OK. [1] I'm baffled since it looks like you are doing everything correctly. [2] I added your screen shot to your question, and changed the NB version to 11.2. Please review and correct if necessary. [3] Hopefully someone else can come up with a solution. [4] My only other suggestion is to create a new trivial JDK 13 project (**File > New Project... > Java with Ant > Java Application**), and see if you still also hit the same problem with that project. (I think you will but it's simple to try it.) [5] If you restart NetBeans and then reproduce the error the log shouldn't be too large to post. – skomisa Nov 16 '19 at 06:05
  • Update; I removed all plug-ins and restarted NBs. Created new project and problem still exists. I did notice that when I type this much `java.rmi.` that the status line in NB flashes "Downloading HTTP Javadoc" just for a moment. So it looks like its either my config or a NB bug. (Reformat by skomisa looks good. thank you) – Bcwilmot Nov 16 '19 at 21:08
  • Last lines of IDE Log:
    `INFO [org.netbeans.api.java.source.ElementHandle]: Resolved type is null for kind = CLASS
    INFO [org.netbeans.api.java.source.ElementHandle]: Cannot resolve: ElementHandle[kind=CLASS; sigs=jdk.nashorn.internal.objects.Global ] `{I sure wish I could format comments using this darn markdown syntax}
    – Bcwilmot Nov 16 '19 at 21:19
  • I can reproduce your problem! If I create a trivial JDK 13 project using Ant (**File > New Project... > Java with Ant > Java Application**) then I get _"Javadoc not found"_ for `java.rmi.`, but if I create a Maven project or a Gradle project using JDK 13 then Javadoc for `java.rmi.` works fine. Also, if I downgrade the JDK 13 Ant project to use JDK 8 instead then Javadoc for `java.rmi.` also works fine. It looks like the problem is specific to JDK 13 Ant projects. Was your original project that gave _"Javadoc not found"_ also an Ant based project? – skomisa Nov 16 '19 at 23:56
  • I know little about Ant and Maven. I see an ant command issued in the output window when I compile code. Can't seem to find any property inside project properties related to either product. I use NB right as installed with little understanding of internals. Is this a bug or something I need to do with Maven? – Bcwilmot Nov 17 '19 at 05:13
  • Okay.... I always use ant. The Ant/Maven decision is when a new project is defined. Don't know (in terms of a NB project definition) what would be different or how to convert. – Bcwilmot Nov 17 '19 at 05:21
  • I think you've hit a bug in NetBeans when using Javadocs for an Ant project which uses JDK 13 (or JDK 11). There is no problem if the project is created with Maven or Gradle, or JDK 8 is used. I'll raise a bug report with NetBeans. – skomisa Nov 17 '19 at 08:23