Wednesday, October 27, 2010

How to fix missing source for latest Java for Mac OS X 6 22

This will make clicking through to the JDK source work in Eclipse again after updating to the latest Java for Mac OS X.
  1. Go to http://connect.apple.com and download Java for Mac OS X 10.6 Update 3 Developer Package
  2. Install it.
  3. Open a Terminal.app window
  4. sudo -s
  5. cd /System/Library/Frameworks/JavaVM.framework/Home
  6. ln -s /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home/src.jar .
  7. ln -s /Library/Java/JavaVirtualMachines/1.6.0_22-b04-307.jdk/Contents/Home/docs.jar .

7 comments:

jnamnath said...

Wait... you haven't switched to Python + git yet?

Jon Scott Stevens said...

stop stalking my blog and get back to work. =)

jnamnath said...

google reader... easy, passive stalking. :P

Mike said...

Couldn't you just point your IDE at the JDK bundle in /Library/Java/JavaVirtualMachines? Symlinking the src and docs from the system installed one will only cause it to be out of date when they system upgrades again.

Jon Scott Stevens said...

There are many ways to skin a cat. This is the one I prefer.

martinrleon said...

It's rare that I have anything bad to say about Apple, there are thigs that are annoying but much less so than the alternatives. This one is just plain DUMB! I can't believe this kind of hack has to be done. Thanks for figuring it out! I installed the Java package but couldn't figure out whether it even did anything. I hate Apple for this (at least for a couple of hours). Thanks for posting your solution!

martinrleon said...
This comment has been removed by the author.