离线 Java 文档
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/449558/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Offline Java Documentation
提问by BCS
I've finally gotten around to learning Java and am looking for some documentation for Java that I can download and read offline. Something like Sun's stuffbut zipped up or as a PDF or CHM.
我终于开始学习 Java,并且正在寻找一些可以下载和离线阅读的 Java 文档。类似于Sun 的东西,但被压缩或作为 PDF 或 CHM。
I'm using Eclipse so something that integrates with that would be nice. It already seems to have some of what I want somewhere (the javadoc stuff) but I don't see how to search it and I'm not seeing a language ref.
我正在使用 Eclipse,所以与它集成的东西会很好。它似乎已经有一些我想要的东西(javadoc 的东西),但我不知道如何搜索它,也没有看到语言参考。
采纳答案by Timur Fanshteyn
Full Documentation in Windows Help Format http://javadoc.allimant.org/
Windows 帮助格式的完整文档 http://javadoc.allimant.org/
回答by Mark Renouf
Read the JavaDocs. Especially the java.util.Collections framework. The core Java library is extremely well documented for the most part.
阅读 JavaDocs。特别是 java.util.Collections 框架。核心 Java 库的大部分文档都非常详细。
I also tend to browse the source to get a good understanding of how things work. You should java the src.zip set up so you can browse inside JDK classes. It will also teach you good design; learn from the masters!
我还倾向于浏览源代码以更好地了解事物的工作原理。您应该将 src.zip 设置为 java,以便您可以浏览 JDK 类。它还会教你好的设计;向大师学习!
Some very useful commands to memorize in eclipse:
在eclipse中记住一些非常有用的命令:
Ctrl-Shift-TOpen Type: search as you type a class name, select it to jump directly to it. You do not need to know the package, it searches all classes by their simple names.
Ctrl-Shift-T打开类型:在键入类名时搜索,选择它可以直接跳转到它。您不需要知道包,它会通过简单的名称搜索所有类。
F4Open Type Hierarchy. With the cursor on any class reference in source or on a class in the package explorer, hitting F4 will open a type hierarchy.
F4打开类型层次结构。将光标放在源代码中的任何类引用或包浏览器中的类上时,按 F4 将打开一个类型层次结构。
Ctrl-TQuick type hierarchy. It's like F4 but opens a quick popup browser. Very convenient. My favorite use is to place it on an interface, and Ctrl-T will list all implementing classes.
Ctrl-T快速类型层次结构。它类似于 F4,但会打开一个快速弹出浏览器。很方便。我最喜欢的用法是把它放在一个接口上,Ctrl-T 会列出所有实现类。
回答by Uri
I'm not sure that I fully understand your question.
我不确定我是否完全理解你的问题。
If you are interested in materials about learning Java (rather than API references), you can download all of it as a zip file. It will be multiple HTML files, but I've never seen a real problem with browsing them unless I wanted a printout. If you need a printout of the tutorial, just get the tutorial in book form.
如果您对学习 Java 的资料(而不是 API 参考资料)感兴趣,可以将所有资料下载为 zip 文件。它将是多个 HTML 文件,但我从未见过浏览它们的真正问题,除非我想要打印输出。如果您需要本教程的打印输出,只需以书本形式获取本教程。
If you are looking for the JavaDocs for a specific API, and you use Eclipse, your best bet might be to use the version of Eclipse that is specific for Java and comes packaged with the JDK source code (or just download the source code). You can then read the documentation of methods through different views like the Java Browsing view.
如果您正在寻找特定 API 的 JavaDocs,并且您使用 Eclipse,那么您最好的选择可能是使用特定于 Java 并与 JDK 源代码打包在一起的 Eclipse 版本(或直接下载源代码)。然后,您可以通过不同的视图(如 Java 浏览视图)阅读方法文档。
回答by Jay R.
Once you setup Eclipse for Java development using the Sun JDKin Preferences->Java->Installed JREs, you can attach the Sun javadocarchive file to the JRE in question. Just make sure that you pick the JDK installation directory as the root of the JRE. Eclipse will automatically attach to the src archive there. Then when you make a Java project, you can use the package explorer to browse through the classes and read the javadoc by expanding the JRE System Library entry in your new project. The majority of the api is in the rt.jar.
在 Preferences->Java->Installed JREs 中使用Sun JDK为 Java 开发设置 Eclipse 后,您可以将Sun javadoc存档文件附加到相关 JRE。只需确保选择 JDK 安装目录作为 JRE 的根目录即可。Eclipse 将自动附加到那里的 src 存档。然后,当您创建 Java 项目时,您可以使用包浏览器浏览类并通过展开新项目中的 JRE 系统库条目来阅读 javadoc。大多数 api 都在 rt.jar 中。