问题
Where can I find the source code of the Java API?
回答1:
OpenJDK code: Browse here
For example, if you looking for AWTUtilities.java, go here in the above link:
src› share› classes› com› sun› awt› AWTUtilities.java
- OpenJDK project homepage where they have all the instructions of downloading and building it
- OpenJDK Mercurial Repo hosted here
- JDK Documentation here
回答2:
Install the JDK. The sources for the public classes are packaged in src.zip.
回答3:
You can also find them online at http://www.docjar.org/.
回答4:
I'm not sure what you mean, but here is the API documentation
Source for OpenJDK implementation
回答5:
Presumably you mean the core libraries?
http://openjdk.java.net/groups/core-libs/
You might this alternative useful too:
http://www.gnu.org/software/classpath/
回答6:
If you only need to look up some classes, the following page is also a good source:
http://grepcode.com
It works for different versions of various libraries.
来源:https://stackoverflow.com/questions/4635377/java-api-source-code