Java Learning (1)-view the source code of the JDK class library in eclipse

Source: Internet
Author: User

View the source code of the JDK class library in eclipse !!!

Settings:

1. Click "window"-> "Preferences"-> "Java"-> "installed jres"

2. in this case, the right side of "installed jres" is the List Pane, listing the system's JRE environment. Select Your JRE and click "Edit... ", a window appears (edit JRE)

3. Select the Rt. jar file: "C: \ Program Files \ Java \ jre_1.5.0_06 \ Lib \ RT. Jar"
Click "+" on the left to expand it,

4. after expansion, You can see "Source attachment :( none)", click this item, and click "Source attachment... ", select the “src.zip file under your JDK directory.

5. Click "OK" all the way to the end.

DT. jar is a class library about the runtime environment, mainly a swing package.
Tools. jar is a class library for some tools.
Rt. jar contains the JDK base class library, which is the class file of all classes you see in Java Doc.

Usage:

You can select the type, method, or field name in the Java source code editor or code fragment editing test window, and then open the editor for element definition.

In the Java Editor, select the type, method, or field name. You can also click it only once in the name.
Perform one of the following operations:
1. Select Browse> open declaration from the menu bar
2. From the editor pop-up menu, select open declaration
3. Press F3

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.