tags:

views:

2090

answers:

5

I have installed Eclipse 3.3 on Mac OS X and it does not contain the src.zip file I am used to seeing with Windows and Linux installations. Where can I download the complete source code for the Java 1.5 JDK (must be specific versions).

I have been able to locate the full source code, however it contained the ungenerated Buffer implementations and so navigating NIO code was not possible.

Looking for the Java source typically found in the JDK src.zip, not the VM source.

A: 

Unclear if that is even possible since the Mac JDK is not, to my knowledge, open source. It was created by Apple not Sun.

Matthew Brubaker
To clarify, I am looking for the src.zip that contains the Java source for the JDK, rather than the VM source.
ng
That's what I meant, I don't know that they are the same since the contract is the only thing required to be maintained.
Matthew Brubaker
+2  A: 

You can get the Developer Documentation, which includes the source. The download requires you to have an ADC account.

Guðmundur Bjarni
Is there any way to acquire the Java src.zip from elsewhere. Apple only implement the JVM.
ng
Yes. From Sun. Download a JDK for some other operating system (e.g., Linux).
Brian Clapper
Thanks, I was thinking that was what I was going to have to resort to.
ng
+1  A: 

Brian Clapper has already mentioned it in a comment, but the JDK downloads from Sun include src.zip. I don't know if there's any way to get it other than installing on a target platform, but you can install it on a Windows or Linux (virtual) machine and get src.zip from there.

Specifically for Java 1.5, the downloads are here

[Update] Also, source distributions of the JDK are available from Sun from here. It seems that SCSL link is messed up and throws you for a loop, but JRL still works (if you don't mind going through it).

ykaganovich
Ya, but this does not give the complete code. The ByteBuffer etc are still templates, and other generated code is missing.
ng
A: 

It is located in

/System/Library/Frameworks/JavaVM.framework/Versions.1.5.0/Home/src.jar

I do have the XCode stuff installed found on the installation disks that come with a Mac, so I don't know if the source code appears on a standard Mac installation of OSX.

Miles D
Well, does not seem to be "find . /System/Library/Frameworks/JavaVM.framework/Versions | grep src" produced nothing. I have approx 8 versions on my machine.
ng
A: 

/System/Library/Frameworks/JavaVM.framework/Versions/1.5.0/Home/src.jar

More details on: http://confluence.concord.org/display/CCTR/Get+local+copies+of+Mac+OS+X+Java+source+code+and+Javadoc

Bhuvan Gupta