Quantcast
Channel: Navin Peiris » OS X
Viewing all articles
Browse latest Browse all 5

Download and Install Java Source and Documentation on OS X

$
0
0

UPDATE: These instructions have been updated with the changes made to the Apple Developer Downloads site, and modified to not be specific to Lion.

The Java installation in OS X doesn’t come with the JDK source code and documentation which any Java developer will require sooner or later. For me this becomes a hassle when I want to browse or lookup something in the Java API through Eclipse. This guide shows you how to download and install a Java for Mac OS X Developer Package and show you where you can find the documentation and the source jars, which can then be used in your favourite IDE etc.

First, go to the Apple Developer Downloads site at http://developer.apple.com/downloads and sign in using an Apple Developer ID. You will need to create a developer ID if you don’t already have one.

Next, find and download the Java for OS X Developer Package relevant to the version of Java installed in your machine from the list of downloads shown, for example, at the time this post was edited the latest version was Java for OS X 2012-005 Developer Package. The download appeared on the 2nd page at the time of writing, but it’ll be much easier if you filter the list by entering Java in the search box on the left hand side of the page.

Once the download is complete install this package by clicking on the DMG and then the PKG, and following the instructions in the dialogs.

The source and the documentation artefacts will now be placed in paths similar to that below. Please make sure you substitute the [version] with the appropriate version for your installation:

Source:

/Library/Java/JavaVirtualMachines/[version]/Contents/Home/src.jar

Documentation:

/Library/Java/JavaVirtualMachines/[version]/Contents/Home/docs.jar

For example, on an OS X Lion installation, the relevant paths will be:

/Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/src.jar

and

/Library/Java/JavaVirtualMachines/1.6.0_26-b03-383.jdk/Contents/Home/docs.jar

You can now use these paths to refer to the relevant jars through your IDE or any other application that might require it.



Viewing all articles
Browse latest Browse all 5

Trending Articles