Accessing Java API docs

Discussion in 'Mac Programming' started by pbw, Jul 2, 2009.

  1. pbw
    macrumors newbie

    Joined:
    May 18, 2006
    #1
    I have downloaded the latest Java update, and the associated devdocs from ADC, and installed them. In the devdocs are the src.jar and docs.jar, at /System/Library/Frameworks/JavaVM.Framework/Versions/1.6.0/Home.

    The docs.jar contains the compressed Java API docs, but is there a "Mac" way to access the APIs? I have extracted them and put them in a convenient location, so that I can access then with a browser, which is my most frequent way of looking at them. Is there another way?
     
  2. macrumors G4

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #2
    Do you use an IDE for your Java development? If you do, which one? The way you set up your IDE to look at the documentation depends on which IDE you use.
     
  3. pbw
    thread starter macrumors newbie

    Joined:
    May 18, 2006
    #3
    Thanks for the reply.

    Yes, I use NetBeans and IntelliJ. I have no problem with setting up the docs for use in the IDEs - just tell them where the jar file is.

    However, I frequently just browse the Javadocs, especially when I'm trying to find the right classes to do a particular job. That's when being able to browse with a browser comes in handy.
     
  4. macrumors 6502

    duggram

    Joined:
    Apr 17, 2008
    #4
    Now I don't understand your question. If you can access the JavaDocs from the IDE and you can browse them with your browser, what are you looking for?
     
  5. macrumors 604

    iShater

    Joined:
    Aug 13, 2002
    Location:
    Chicagoland
    #5
    Since a browser cannot read the contents of JARs, you will have to extract the java doc contents into a directory of your choice and view the HTML files from there.
     
  6. macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
  7. macrumors 604

    iShater

    Joined:
    Aug 13, 2002
    Location:
    Chicagoland
    #7
  8. pbw
    thread starter macrumors newbie

    Joined:
    May 18, 2006
    #8
    Exactly, and that's what I have done. My question is whether there is a procedure in place for doing just this, and putting the expanded docs into a standard location. It seems a bit of an oversight for Apple not to provide such a mechanism when they bundle up the src and the docs.

    I saw a reference to a shell script that extracted the docs, in a thread from about 2002/3, for a much earlier version of Java, obviously. I was wondering whether there was a modern equivalent.
     
  9. pbw
    thread starter macrumors newbie

    Joined:
    May 18, 2006
    #9
    Yep. It's useful to be able to access this stuff when I'm offline.
     
  10. macrumors 604

    iShater

    Joined:
    Aug 13, 2002
    Location:
    Chicagoland
    #10
    JARs are just zip files. Either use terminal to extract the contents or use a zip utility to extract it. I don't think there is really an "official" procedure for this.
     
  11. macrumors 601

    sammich

    Joined:
    Sep 26, 2006
    Location:
    Sarcasmville.
    #11
  12. pbw
    thread starter macrumors newbie

    Joined:
    May 18, 2006
    #12
  13. macrumors newbie

    Joined:
    Jul 29, 2009
    #13
    I'm in the same position! It looks as if there used to be a unjarJavaDocumentation.sh for earlier versions, that unpacked to roots such as /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Resources/Documentation/Reference/doc/api/, but I've no idea where that would come from. (There's a Javadoc dashboard widget that looks in the above & equivalent roots for 1.4.2 & 1.6).
     
  14. pbw
    thread starter macrumors newbie

    Joined:
    May 18, 2006
    #14
    That's good to know. In that case, I'll try dropping the expanded docs into Resources/Documentation.
     

Share This Page