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.