view java source code

I frequently use http://docjar.com for this purpose.

Example: I want to see the source code for String. Search for the FQCN, java.lang.string (using the "Package/class Name" option). Click the result you want, then click the source link at the top of the page. Voila: http://www.docjar.com/html/api/java/lang/String.java.html


The Java source code for all the API classes is shipped in the JDK installer in a file named src.zip. It's often just sitting in your install directory. Unzip it, and have a look.

If it's not there, you may have chosen not to install it; reinstall the JDK and watch for the "source code" option, making sure to include it.

Tags:

Java