Java source and documentation on Mac OS X Lion

If you develop in Java on Mac OS X you might have noticed that the JavaDoc documentation and sources from the JDK are missing. Luckily it is very easy to solve.

  1. Download the latest Developer Package from the Apple Developer Downloads Website. (Currently called “Java for Mac OS X 10.7 Developer Package”) and install it.
  2. Add the following jar files to the search path for your JavaDoc (adjust the version in the path if necessary):
    • /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/appledocs.jar
    • /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/docs.jar
  3. Add the following jar file to the search path for your class sources (adjust the version in the path if necessary):
    • /Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/src.jar

In NetBeans you can find these settings in Tools» Java Platforms. You can remove the URLs to the Oracle website.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.