There is one thing pretty annoying with the Apple Java Development Kit : you don't have access to the source code under . Why ? Simply because doesn't ship it with the JDK and therefore Eclipse cannot discover it. So, what can I do if I want to have the source code linked to the JRE library as it is done automatically under Windows ?

Update 2006-05-20 : Thanks to Cedrik Lime (see the first comment), here is a very simple solution :

  • Go to the Apple Developer Connection, in the downloads page.
  • Download the J2SE 5.0 Release 4 Developer Documentation package. You may have to log on the ADC. Registration is free if you don't have an account.
  • Once downloaded, install it.
  • In Eclipse, go to Window menu and open the Preferences... dialog.
  • Go to Java/Installed JRE panel. You should see a list of the currently detected MacOS X JVMs.
  • Click on the Add... button to add a new JRE definition.
  • Type JDK 1.5.0 in the JRE name field (or whatever you want).
  • Click on the Browse... button and selec the /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home folder.
  • A list a jars must show up. A part of them should have them source attachement filed.
  • Click on the Ok button.
  • Click on the Ok button.

That's it. You have an Eclipse that can show you the JDK source code when you need it. Of course, you don't have access to all the source because, doesn't ship all the JDK source code.