Eclipse Debug ' Source not found '

Source: Internet
Author: User

Debugging with Eclispe has been plagued by a problem: Source not found.

The problem is caused by debugging into a jar with no source code.

Brief description:

Edit Source Lookup Path ... Can solve the debug process cannot find the source of the problem, PS, need to restart the service.

Configure Build Path can give the source code to Jarattach, this tube is reading the code can see the contents of the jar package.

Specific steps:

Before clicking Edit Source Lookup Path ... To add the source search path

But often encountered the problem is added after one o'clock OK, the interface flash, and then back to the ' Source not found ' interface.

Today because must debug the source of things, so thoroughly engaged in this problem.

My environment is: + Maven 3.2.1

First the source project down, and manually hit the Source.jar, if not willing to play Source.jar, you can directly lead the directory, first into the Src/main/java directory, with the COM package in the same level directory, and then execute the command:

Paste the generated Xxx-source.jar cut into one of the external directories. Then in the edit Source Lookup Path ... Add ...-externalarchive

Choose the Xxx-source.jar you want to add

Then the interface will appear a flash, and then back to the ' Edit Source Lookup Path ... ' This interface situation, in fact, the shutdown service restart a bit better, I always do not understand why, is again added, but also find ways to add another jar or project, and finally messed up.

If you add a lookup Path that you shouldn't add, you can click menu Run, Debug configurations .... Source to manage Lookuppath

The following is a complex example:

When using MAVEN to manage large-scale jar package sets and project sets, it is often problematic to introduce versions of multiple jar packages, for example, there are currently three projects, and the P1 reference P2,P2 reference P3,P2 relies on a-1.0.jar,p3 dependency A-2.0.jar. According to the MAVEN selection jar package, the first explicit, then depth, after order principle, A-1.0.jar eventually will be dependent on the project, so in configure Build path, 1.0 of the source package to attach to the jar, in the debug edit Source Lookup Path ... should also be 1.0 of the source code package selected, I was in the test is 2.0 of the source package to the lookup path, and then in configure Build Path, regardless of which package attach on, all in debug occurred line offset.

So, Configure Build path and edit source Lookup path are two different things, a tube reading code, a pipe debug code, but for that kind of entry code, which is not the code to tune it before, but the code of the container call, must first read it, To make a breakpoint, don't you?

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.