JavaDoc location from Apple Extensions

与世无争的帅哥 提交于 2020-01-04 06:46:09

问题


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

My Question is simple:

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.

Where are these Extensions explained? Is there JavaDoc available?

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.

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.

EDIT: JavaDoc for the Pointer Class for example


回答1:


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. Download the source code for the JDK, then make the javadoc yourself:

    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.

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

    For java 7:

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

    For java 8:

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

    Now that you've downloaded the source, you just need to make the 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)
    

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

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

    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.

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

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

    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.

    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.

  3. Use mine.

    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)


来源:https://stackoverflow.com/questions/14549629/javadoc-location-from-apple-extensions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!