Javadocs 没有出现在 Java 10 的 Apache netbeans 上 [英] Javadocs are not appearing on Apache netbeans for java 10

查看:31
本文介绍了Javadocs 没有出现在 Java 10 的 Apache netbeans 上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Netbeans 版本:Apache NetBeans 9.0

Java 版本:Java 10

无论我做什么,我都无法让 javadoc 出现并显示任何方法的详细信息.

我已经进入了 Java 平台和 Javadocs,我已经为 javadocs 设置了 Zip、解压和 URL,但它就是行不通...

Java 文档:jdk-10.0.1_doc-all

网址:

解决方案

您可以使用 URL 或压缩文档的文件位置链接到 NetBeans 中的 JDK 帮助文档.两种方法都适用于 Java 10 使用Apache NetBeans 9.0 RC1:

显然,您只需要这些条目之一.两者都显示在上面的屏幕截图中,纯粹是为了解决您的问题,并且都可以在添加 JDK 10 平台期间或稍后进行设置.

用于使用 JDK Javadocs 的文件位置:

  • <小时>

    于 2018 年 11 月 8 日更新,以解决在 NB 9.0 中使用 OpenJDK 10 的问题:

    • 我删除了除 JDK 1.8(默认)之外的所有 Java 平台.
    • 我关闭了 NetBeans 并删除了缓存和用户目录,如帮助 > 关于中所示.
    • 我重新启动了 NetBeans 并创建了一个名为 Optional.orElseThrow() 的普通 Java 应用程序,该应用程序已添加到 JDK 10 中.正如预期的那样,该项目不会使用平台 JDK 1.8(默认).
    • 我添加了 OpenJDK 10 作为 Java 平台,但没有指定任何 Javadoc.

    • 我更新了项目以使用 OpenJDK 10 而不是 JDK 1.8(默认).Java 10 方法的帮助工作正常,无需指定任何 Javadoc 位置!

    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??

    解决方案

    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:

    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:


    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.

    • 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!

    这篇关于Javadocs 没有出现在 Java 10 的 Apache netbeans 上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆