Apple 扩展中的 JavaDoc 位置 [英] JavaDoc location from Apple Extensions

查看:58
本文介绍了Apple 扩展中的 JavaDoc 位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在 OS X Lion 下开发 Java 应用程序,我想在 Java 7 中使用 Apple 扩展.

I'm developing an Java-Application under OS X Lion and i want to use the Apple Extensions in Java 7.

我的问题很简单:

我将 Apple Extensiosn 放入我的类路径中,它们位于:/System/Library/Java但我在该目录中找不到任何 JavaDoc.

I put the Apple Extensiosn into my Classpath, they are located here: /System/Library/Java but I can't find any JavaDocs in that directory.

这些扩展在哪里解释?有 JavaDoc 吗?

Where are these Extensions explained? Is there JavaDoc available?

刚刚找到那个网站:http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdate3LeopardUpdate8RN/ResolvedIssues/ResolvedIssues.html#//apple_ref/doc/uid/TP40010380LinkElementID3_12Dont 但并不是很有帮助.

Just found that site: http://developer.apple.com/library/mac/#releasenotes/Java/JavaSnowLeopardUpdate3LeopardUpdate8RN/ResolvedIssues/ResolvedIssues.html#//apple_ref/doc/uid/TP40010380-CH3-DontLinkElementID_12 but wasn't really helpful.

再说一遍,我不是在 JavaDoc 中搜索 JDK 本身,而是从这些 Java-Apple-Extensions 中搜索 JavaDoc.

To say it again, I'm not searching the JavaDoc for the JDK iteself, I'm searching for the JavaDoc from these Java-Apple-Extensions.

例如指针类的 JavaDoc

JavaDoc for the Pointer Class for example

推荐答案

不幸的是,据我所知,Apple Java 扩展的 javadoc 似乎没有包含在 OpenJDK 7 的下载中.有 3 种方法(AFAIK)来解决这个问题.

Unfortunately, as far as I can tell, a javadoc for the Apple Java Extensions does not seem to be included in the download for OpenJDK 7. There are 3 ways (AFAIK) to get around this.

  1. 下载 JDK 的源代码,然后自己制作 javadoc:

  1. Download the source code for the JDK, then make the javadoc yourself:

这是最难的方法,但也是最彻底的.您必须安装 hg (mercurial) 才能获取 OpenJDK 的源代码.如果尚未安装,您可以使用 homebrew brew install hg 或 MacPorts sudo port install hg 进行安装.

This is the hardest way, but the most thorough. You must have hg (mercurial) installed to get the source code for OpenJDK. If it isn't installed already, you can install it with homebrew brew install hg or MacPorts sudo port install hg.

安装hg后,可以下载JDK的源代码:

After installing hg, you can download the source code for the JDK:

对于 Java 7:

hg clone http://hg.openjdk.java.net/jdk7u/jdk7u/jdk jdk

对于 Java 8:

hg clone http://hg.openjdk.java.net/jdk8/jdk8/jdk jdk

现在您已经下载了源代码,您只需要制作 javadoc.

Now that you've downloaded the source, you just need to make the javadoc.

为 Apple Java 扩展构建 javadoc:

To build the javadoc just for the Apple Java Extensions:

javadoc -d doc $(find jdk/src/macosx/classes/apple jdk/src/macosx/classes/com/apple -name *.java)

为整个 JDK(包括 Apple Java 扩展)构建 javadoc:

To build the javadoc for the entire JDK (including Apple Java Extensions):

javadoc -d doc $(find jdk/src/macosx/classes/ -name *.java)

如果您使用 Java 8 构建 javadoc,则必须提供 -Xdoclint:none 作为 javadoc 的附加参数才能使其工作.

If you use Java 8 to build the javadoc, you'll have to supply -Xdoclint:none as an additional argument to javadoc to make it work.

这两种方法中的任何一种都会将所有文档放在当前目录中名为 doc 的文件夹中.之后您可以删除 jdk 文件夹(这是放置 JDK 源代码的位置).

Either of these will put all of the docs in a folder called doc in the current directory. You can delete the jdk folder afterwards (that's where the JDK source got put).

使用旧版本(来自 Apple 的 java 6).

Use an old version (from Apple's java 6).

Apple 下载的 java 6(仅限开发人员 JDK)包括 Apple Java 扩展的 javadoc.AFAIK 从那以后他们没有改变,所以它是旧的应该没有关系(尽管它会有不同的 javadoc 风格).目前,Apple 的 Java 开发人员包可从 https://developer.apple.com/获得downloads/index.action?q=java,但它们经常在 developer.apple.com 周围更改,因此该链接可能很快就会中断.

Apple's downloads of java 6 (only the developer JDK) included the javadocs for the Apple Java Extensions. AFAIK they have not changed since then, so it shouldn't matter that it's old (although it will have a different javadoc style). Currently, Apple's java developer package is available from https://developer.apple.com/downloads/index.action?q=java, but they change around developer.apple.com rather often, so that link will probably break pretty soon.

下载并安装后,它会在 /Library/Java/JavaVirtualMachines/ 中安装一个名为 1.6.0_something 的新 JDK.在其中(右键单击 → 显示包内容),在 Contents/Home 中,是 appledocs.jar,其中包含您要查找的 javadoc.

Once you download and install this, it will install a new JDK in /Library/Java/JavaVirtualMachines/ called 1.6.0_something. Inside this (Right Click → Show Package Contents), in Contents/Home, is appledocs.jar, which contains the javadoc you are looking for.

用我的.

我使用我在第 1 节中描述的完全相同的方法为 Apple Java 扩展编译了一个 javadoc.我不会让它保持最新状态,但 AFAIK 他们仍然没有更新 Apple Java 扩展,所以它不应该没关系.

I compiled a javadoc for Apple Java Extensions using the exact same methods I described in section 1. I'm not going to keep it up to date, but AFAIK they're not still updating Apple Java Extensions, so it shouldn't matter.

  • Java 6 (taken from Apple Java 6)
  • Java 7 (built from OpenJDK 7)
  • Java 8 (built from OpenJDK 8)

这篇关于Apple 扩展中的 JavaDoc 位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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