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

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

问题描述

Netbeans版本:Apache NetBeans 9.0

Netbeans Version: Apache NetBeans 9.0

Java版本:Java 10

Java version: Java 10

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

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

我已经进入Java平台和Javadocs,已经为Javadocs设置了Zip,unzip和URL,但是它只是行不通...

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

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.

编辑回复: 即使添加了"java.base/",它仍然无法正常工作.我什至完全删除了netbeans和所有appdata.重新下载它,安装JDK11,然后再次尝试文档...但还是一样.我疯了吗?

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

推荐答案

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

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:

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

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.

对于JDK Javadocs使用文件位置:

For using the file location for JDK Javadocs:

  • 下载Javadoc文件到任意目录.
  • 工具> Java平台> Javadoc 标签> {您的jdk 10平台}>添加ZIP/文件夹...
  • 导航至下载的Javadoc文件,在我的情况下为 jdk-10-ea + 42_doc-all.zip .
  • 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.

对于JDK Javadocs使用URL:

For using the URL for JDK Javadocs:

  • Tools > Java Platforms > Javadoc tab > {your jdk 10 platform} > Add URL...
  • Add the URL, which was https://docs.oracle.com/javase/10/docs/api/ in my case.

如果您仍然有问题:

  • 确保您使用的是最新版本的NetBeans 9.0 RC1 . /li>
  • 使用我使用的特定URL和Javadoc文件,因为这两种方法对我来说绝对有效.
  • 如果仍然无法正常工作,请删除JDK 10平台,重新启动NetBeans,然后重试. (我没有提出具体建议的理由,但只需花两分钟即可尝试.)

我个人的喜好是使用本地zip文件而不是URL,因为它速度更快并且您不需要Internet访问.这是一个屏幕截图,显示了JDK10中新增的 Optional.orElseThrow()的Javadoc:

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:

已于2018年11月8日更新,以解决OpenJDK 10与NB 9.0一起使用的问题:

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

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

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

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

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天全站免登陆