Teach you to view the source code in eclipse

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:
write picture description here
(1) Open the Window->Preferences of eclipse, and open the Preferences tab.
write picture description here

(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.
write picture description here
(3) Edit JRE tab, find the rt.jar installation path, expand to see Source attachment and javadoc Location
write picture description here
(4) Select Source attachment source item.
write picture description here
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
write picture description here
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.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325471880&siteId=291194637