How to view the source code of JDK and Java framework

Source: Internet
Author: User

The procedure is as follows:

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" cmdsrc.zip "file under your JDK directory (this file is in the root directory of the JDK installation directory)

5. Click "OK" all the way. The setting is complete.

After setting, press Ctrl and then click a JDK method name or class name.Source code. In addition, you can also press F3.

PS:Rt. jar contains the JDK base class library, that is, all the class's classfile that you see in Java Doc contains the source file corresponding to the basic class (that is *. java files). Similarly, we can download the source of each Java open-source framework from the Internet.CodePackage, such as spring-src.zip, and then follow the settings above to view the corresponding Java framework source code.

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.