As a programmer of java development, especially a beginner java programmer. Sometimes it is necessary for us to view the source code of some tool classes in java itself, but before that, we need to make a setting to successfully view the source code of our JKD itself. This work is done by me today with everyone.
The steps are as follows:
1. Import the source code:
(1) Open the Window->Preferences of eclipse, and open the Preferences tab.
(2) Preferences tab: java->Installde JREs Double-click to open, see the list editor on the right, select the environment installation path, and then Edit to open the Edit JRE tab.
(3) Edit JRE tab, find the rt.jar installation path, expand to see Source attachment and javadoc Location
(4) Select Source attachment source item.
ok done!
In this way, you can find the basic source code in eclipse.
How to view, put the cursor on the method you want to view, a box will be displayed, such as the first one in the
red box is to view the source code, the second is to view the API, but the local AIP has not been set here.
2. Import API
Proceed as follows:
(1) Prepare the web version of the API
(2) The import step starts from step (3) above, and it is done according to the above operation.
However, I think it is too troublesome to view the API in eclipse, so I usually use the API of the .chm file, and then open it directly for viewing.