Is it always a best practice to know the implementation and structure flow of the source classes that JDK provides us for developing applications. The src.zip file inside the JDK diretory contains the archives of the source files of all the classes that make up core Java API (that includes java.*, javax.*, and some org.*). These files are for informational purposes only and to help developers in using the Java Programming Language.

So when you are programming in Eclipse if you want to know the source file of the class to understand the internal representation of that class simply highlight or hover your mouse pointer onto that class and press Ctrl key for some Eclipse versions (Fn) F2 and (Fn) F3 might work. Then you will get to see the source file of that particular class, its member variables, various behavioral methods etc.

Sometimes you might get a screen in Eclipse saying you don’t have the sources installed. You have to then simply add this src.zip file by clicking on the attach file button.

Hope this information was useful and add more here if anything’s missing.

Leave a Reply