My IDE is really good about finding the corresponding Java source code for JDK classes. For example, I can open java.lang.String
in my IDE and see the actual Java source code. However, when I try to open sun.net.www.http.HttpClient
(which is included in the Java SDK), my IDE just shows me the decompiled .class
file, which is difficult to read.
My IDE on macOS is looking for the source code in /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/src.zip
, and if I unzip that archive I can find String.java
, but HttpClient.java
is nowhere to be found. So it makes sense that my IDE can't find it.
Where can I get the complete JDK source code?