Home > Java > Fixed ‘View Javadoc in external Browser’ in IntelliJ IDEA

Fixed ‘View Javadoc in external Browser’ in IntelliJ IDEA

An annoyance in IntelliJ IDEA was that the command ‘View Javadoc in external Browser’ did not work
per default on a mac. On a mac with it’s own java sources the api-doc are located inside a jar and therefore
not able to browse through a normal webbrowser. (If you know a browser which can handle a jar://xxx address let me now in a comment)

IntelliJ does not open or extract those files per default so I did by hand with:

cd /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home
jar xf docs.jar // this will extract the contents of the jar
jar xf appledocs.jar // dito

No we need to point IntelliJ to the extracted files. Open your Preferences -> Project Preferences.
Click on the desired JDK and then click on the tab ‘javadocs’. Remove the old entries for the jar and enter
the extracted path
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/docs/api
/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/appledocs/api

Not it works. To test it, move the cursor to a class,member whatever and press <Shift>+<F1>. The appropriate javadoc should open in your default browser.

This is not a bug fix, just a bad default configuration. I’d like to see this fixed in the next release…

mjava Java , ,

  1. Alex K
    26. April 2008, 03:01 | #1

    Thanks , man, that’s what I was looking for.
    Do you think it’s a problem with IDEA or browsers? Is it supposed to work with JARs this way at all, I winder..

  2. 26. April 2008, 08:01 | #2

    I think it is a browser problem. jar:// is not a protocoll.

    In the structure view of IDEA, we are able to browse through a jar file though…. ;)

  3. Henrik Schmidt-Møller
    7. Juni 2008, 20:54 | #3

    See http://www.jetbrains.net/jira/browse/IDEABKL-4768 for another workaround. As it turns out, it´s a problem with both Idea and OS X. At least, if have not been able to find any way of passing invalid URLs to firefox without resorting to AppleScript (which is not particurlarly well supported by Firefox). If anyone has a nicer way of doing it, please let me know.

  1. Bisher keine Trackbacks
Du musst Dich anmelden um einen Kommentar zu schreiben