Java (6) ------ source code learning --- How to view the source code of the jar package in myeclipse

Source: Internet
Author: User

Java (6) ------ source code learning --- How to view the source code of the jar package in myeclipse

The idea of viewing the source code and code specifications are an important means for us to learn and improve the code writing capability.

Sometimes we want to see the implementation of classes and methods in a jar package, but cannot view them.

This is because the source code of the jar package is not loaded. You only need to find the source code of the jar package and set the path.

Source code download

You need to find the source code by version, which can be a zip package or a jar package.

Here are a few websites looking for the source code, you can also go to the jar package's official website to find.

Github

Https://github.com/openjdk-mirror/jdk7u-jdk

Sourceforge

Https://sourceforge.net/projects/jdk7src? Source = directory

Add source code

There are three ways to add source code:

Add

Add from project buildPath

Automatically add maven

If you have used maven to manage jar files, you can easily download the source code from the maven package. You only need to modify the configuration.

If you are not familiar with maven, see

Introduction to Maven

The source code for automatic download of maven settings is as follows:

Select windows-Preferences-Maven-Download Artifact Sources.

Ps: here we record how to view the source code of the packages included in the project. As for external projects, such as tomcat server, the source code is a complete project, find the source code and load it into a project.

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.