With each update of Java on OS X, Apple nukes all the things you have done to ensure a proper ability to peruse the JDK source files. Which is a pita being a Java developer. How do you get the source again in your IDE (in my case Eclipse Indigo):
- Download and install the javadeveloper_for_mac_os_x_10.6__10m3425.dmg from developer.apple.com (free registration required)
- Install the client update (comes from the automatic update functionality in OS X), it doesn’t matter in which order you do these two steps)
Next run the following commands in a terminal:
cd /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_26-b03-384.jdk/Contents/Home/src.jar sudo ln -s /Library/Java/JavaVirtualMachines/1.6.0_26-b03-384.jdk/Contents/Home/docs.jar
Eclipse will now be able to find the sources for the Java classes.
If you have problems finding the OS X Java developer downloads:
- Go to: Resources
- Click on “developer downloads”
- Click on “Java” in the right side menu
Apple made it impossible to provide a direct link, so you’ll have to navigate the developer website yourself.
(updated with navigation to Java downloads)