I had referenced Ted Wise's post Using Java 1.5 and Java 1.4 on Snow Leopard in a project, and happened to notice a comment from a week ago about someone having trouble getting Java 1.4 to work in Mac OS X 10.7/Lion, so I decided to check it out, since I might also run into it later.

I'm using Snow Leopard currently, so I used a free utility called unpkg to look at the Java for Mac OS X 10.7released from Apple, as well as the other two latest non-preview releases: Java for Mac OS X 10.6 Update 4 and Java for Mac OS X 10.5 Update 9.

Even though Java for Mac OS X 10.5 Update 5 contained the src.jar for 1.4.2_22, it was axed in Java for Mac OS X 10.5 Update 6, with the statement "J2SE 1.4.2 is no longer being updated to fix issues and is therefore disabled by default in this update." (Note that Oracle's (formerly Sun's) Java 1.4 had reached EOL much earlier on October 30th, 2008.)

The current Java for Mac OS X 10.5 Update 9 contains a src.jar for Java 1.5/5.0 (1.5.0_28-b04) and one for 1.6/6.0 (1.6.0_24-b07-334). (Note that Oracle's (formerly Sun's) Java 1.5 reached its EOSL on November 3, 2009.) However, Apple's Java for OS X 10.6 and 10.7 do not contain Java 1.5/5.0 anymore; it is only a symlink to 1.6/6.0.

Java for Mac OS X 10.6 Update 4 only contains a src.jar for 1.6/6.0 (also 1.6.0_24-b07-334).

Java for Mac OS X 10.7 (at time of writing was not listed in support.apple.com, but from what I can see it is not a preview release in the Apple Developer site, so is ok to discuss here) does not contain a src.jar even though it contains 1.6.0_24-b07-345 (according to its System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Info.plist).

I'm not sure why Java for Mac OS X 10.7 included a 1.6 build of Java without the associated src.jar. Was it an oversight or intentional? Sure, it is the same version of Java, so perhaps it is very close or has the same source code as Java for Mac OS X 10.6 Update 4, but still, the build number was incremented (by 1, so I kind of doubt it was a big change- it might have just been a recompilation).

If you're interested in Java 1.7 (7.0), Apple announced the OpenJDK project for Mac OS X in Nov 2010. There is more info on the OpenJDK OS X port project on its project page,wiki, and you can check out the source if you'd like.