The JDK 1.6 I'm currently using on OS X v10.8 (Mountain Lion) did not come with a src.zip
either, and as far as I can tell there is no supported Mac OS X JDK for 1.6 available anymore.
So I downloaded the OpenJDK source (using the links from the accepted answer (+1)) then ran:
cd ~/Downloads
mkdir jdk6src
cd jdk6src
tar xf ../openjdk-6-src-b27-26_oct_2012.tar.gz
cd jdk/src/share/classes
jar cf /System/Library/Java/JavaVirtualMachines/1.6.0.jdk/Contents/Home/src.jar *
(Your file names and paths may vary...)
Associate that src.jar
with the appropriate Java platform in your IDE and you should be good to go.
There are some discrepancies between the OpenJDK source and the JDK I'm currently running (line numbers don't match up in the debugger, for one), but if all you want is a zip/jar to point your IDE to for the relatively few cases you need to peek at some code to understand how something works, then this should do the trick.
src.zip
file that contains the public Java API in the JDK installation directory. Is that what you're looking for (I've mainly used Windows, so maybe the Linux distro doesn't have it). – Restate/usr/lib/jvm
? I found the src.zip under/usr/lib/jvm/jdk-8-oracle-x64/
in my machine. – Goulash