Third-party libraries in Eclipse cannot navigate source code, and third-party libraries in eclipse

Source: Internet
Author: User

Third-party libraries in Eclipse cannot navigate source code, and third-party libraries in eclipse

Preface (nonsense): Eclipse cannot navigate code, and there are many possibilities. Here we only discuss how it is a very simple Case to reference third-party libraries, however, it seems that the search capability is not very good, and I did not find a specific solution, so I did my research.

Body:

Well .. The year May is almost over. If you don't do anything, it will seem like you don't like learning (haha, Who Cares ?).

A recently completed project is coming online, so it is relatively idle (in fact, you have always been idle ?! What is "UNIX network programming" on your desk ?), Some of the Team will look for JAVA-related jobs in the future (although they are interested in developing language tastes, they have never been forced to inject any value in this field ), so I took a few JAVA powders (I was C ++ at the beginning, and now I am a variety of powders (I will not admit it is soft powder anyway, although I do .)) StartedJob-Oriented Project.

Of course, the habit of logging is indispensable for projects. Log4j was initially used.

It is normal to use it after the download is angry and referenced in the project, but when we want to conveniently view the source code, the content shown is displayed, telling us that the source code is not found.

 

Because Eclipse does not know where the directory of your third-party library is located, you do not need to search for the source code by yourself. You have to package the source code to let Eclipse know where the path is.

 

ClickAttach SourceClickExternal Location

A select box will pop up asking you to select a jar package or zip package,Here, we will use the shell zip command to package the Log4j source code, and then let Eclipse know the path of this package..

 

Please use it skillfullyCtrl + Alt + TOpen your shell and enter

zip -r YourLog4jLocation/src/main/java src.zip

Generate a new src.zip file (located inYourLog4jLocation/src/main/java) Select this src.zip in the previous example.

After all, let's talk about the sauce:

 

Go to the Source attachment under the jar you referenced, and the path is displayed.

Finished. The doc solution is the same.

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.