Eclipse 中的离线 Java API 文档?

发布于 2024-10-11 16:33:31 字数 36 浏览 9 评论 0原文

是否有集成任何其他离线方式来获取 Java API 文档?

Is there an integration of any other off line way to get the Java API docs?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

比忠 2024-10-18 16:33:32

如果您的开发计算机上没有 Internet 连接,或者您想要停止访问文档的 Web 流量,则可以将文档存储在本地硬盘上。

  1. 启动您最喜欢的 Web 浏览器并导航到 http://www. oracle.com/technetwork/java/javase/downloads/index.html#docs
  2. 找到所需的文档,接受许可协议,然后单击下载标题下显示的链接。
  3. 在 Eclipse 中,打开Window 菜单,然后选择Preferences
  4. 在搜索栏中,键入 jre,然后单击已安装的 JRE
  5. 选择名为 java 的术语,或其他术语,例如 jre1.8.0_181
    • 其类型必须是标准虚拟机
  6. 单击编辑按钮。
  7. JRE 系统库 部分中,选择以 rt.jar 结尾的库,然后单击 Javadoc Location... 按钮。
  8. 标记存档中的Javadoc 单选按钮。
  9. 存档路径字段中,输入或浏览您的完整文档路径(例如/home/docs/jdk-8u181-doc.zip) 。
  10. 存档内的路径字段中,输入或浏览以查找api/index.html文件的位置(例如docs/api )。
  11. 单击验证按钮以确保所有设置均正确。
  12. 单击OK 按钮,然后单击Finish 按钮,最后单击Apply &关闭按钮。您的文档现已链接到您指定的文件。

If you have no internet connection on your development machine, or if you want to stop the Web traffic for accessing the documentation, you can store the documentation on your local hard drive.

  1. Start your favorite Web browser and navigate to http://www.oracle.com/technetwork/java/javase/downloads/index.html#docs
  2. Find your desired documentation, accept the license agreement, and then click the link displayed under the Download header.
  3. In Eclipse, open the Window menu, then select Preferences.
  4. In the search bar, type jre, and then click Installed JREs.
  5. Select the one named java, or another term like jre1.8.0_181.
    • Its type must be Standard VM.
  6. Click the Edit button.
  7. In the JRE system libraries section, select the library ending with rt.jar, and click the Javadoc Location... button.
  8. Mark the Javadoc in archive radio button.
  9. In the Archive path field, enter or Browse for your full documentation path (e.g. /home/docs/jdk-8u181-doc.zip).
  10. In the Path within archive field, enter or Browse for the location of the api/index.html file (e.g. docs/api).
  11. Click the Validate button to ensure everything is set correctly.
  12. Click the OK button, then the Finish button, and finally the Apply & Close button. Your documentation is now linked to the file you specified.
灰色世界里的红玫瑰 2024-10-18 16:33:32

只是一个快速贡献:
我没有选择 7“存档中的 Javadoc”,而是将 javadoc 位置路径 (URL) 更改为我的目录,我在其中解压缩了文档。
希望有帮助!

Just a quick contribution:
Instead of selecting 7 "Javadoc in archive", I changed the javadoc location path (URL) to my directory, where I have unzipped my doc.
Hope its help!!!

双马尾 2024-10-18 16:33:32

这对我有用(Java 8):

  1. 转到您的 JDK 安装。 (C:\Program Files\Java\jdk1.8.0_66 对我来说)。

  2. 解压 src.zip 文件(对我来说变成 C:\Program Files\Java\jdk1.8.0_66\src\)。

  3. 在 Eclipse 编辑器窗口中:CTRL + 单击 java.lang 库类。 (类似于 String)。

  4. Eclipse 会抱怨未找到源并告诉您没有源。

  5. 点击附加源 -> 外部位置 -> 外部文件夹

  6. 找到您的源文件夹(C:\Program Files\Java\jdk1.8.0_66\src\ 对我来说)。

  7. 点击确定 -> 确定

  8. 享受。

This worked for me (Java 8):

  1. Go to your JDK installation. (C:\Program Files\Java\jdk1.8.0_66 for me).

  2. Unzip the src.zip file (becomes C:\Program Files\Java\jdk1.8.0_66\src\ for me).

  3. In the Eclipse editor window: CTRL + Click on a java.lang library class. (something like String).

  4. Eclipse will complain Source not found and tell you that you don't have the source.

  5. Click Attach source -> External Location -> External Folder.

  6. Find your source folder (C:\Program Files\Java\jdk1.8.0_66\src\ for me).

  7. Click OK -> OK.

  8. Enjoy.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文