Eclipse java debugging: source not found

后端 未结 30 1930
Happy的楠姐
Happy的楠姐 2020-11-22 15:43

While debugging a java app in eclipse I receive a \"Source not found\" error in two cases:

  • Stepping in to a file in a different project which
30条回答
  •  误落风尘
    2020-11-22 16:40

    Info: This is a possible solution, when you use maven (pom.xml) with couple of projects.

    If you are working with maven, make sure what version you are taking inside the according pom.xml (e. g. 1.0.1-SNAPSHOT ). It might be possible that your code is up-to-date, but your pom.xml dependencies are still taking the old JAR's/Snapshots (with the old code).

    Finding the problem:

    • Try to debug the according file.
    • Therefore, set a breakpoint in the relevant code area.
    • When "source not found" appears, make sure to bind in the right project (where the .java file can be found).
    • The compile .class file opens up in the IDE editor.
    • Click "Link with Editor" to find the according JAR/Snapshot.
    • Now make sure that this JAR is the most recent one. Possibly there is a newer one. In that case, write the most recent version number in the pom.xml.
    • Then do a maven update and build (e. g. "mvn clean install -U") in the right project directory.

提交回复
热议问题