Eclipse java debugging: source not found

后端 未结 30 1635
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:31

    Just 3 steps to configuration Eclipse IDE:

    Note: After updating the Source Lookup paths, you'll have to stop and restart your debug session. Otherwise, the file with the missing source will continue to show "missing source".

    Edit Source Lookup Select the Edit Source Lookup... command [ Edit Source Lookup ] to open the Source Path Dialog, which allows you to make changes to the source lookup path of the selected debug target.

    enter image description here

    enter image description here

    enter image description here

    IMPORTANT Restart Eclipse after this last step.

    0 讨论(0)
  • 2020-11-22 16:32

    I was facing the same issue,I followed the bellow steps.

    Window => Preferences => Java => Installed JREs,

    You see in the above screen Jre1.8.0_12 is selected.

    select the JRE you are using and click Edit. Now You should see the bellow screen.

    Click on the directory, browse for Jdk, It should look like bellow screen.

    click ok, and its done

    0 讨论(0)
  • 2020-11-22 16:33

    When running in debug mode, click Edit Source Lookup after suspended from thread. At this point, we should be able to add the necessary project/jar which contains your source code. After I added my current project in this way, and it solved my problem. Thanks

    0 讨论(0)
  • 2020-11-22 16:34

    In my case in "Attach Source", I added the other maven project directory in the "Source Attachment Configuration" panel. Adding the latest version jar from the m2 repository din't work. All the classes from the other maven project failed to open.

    Here test was my other maven project containing all the java sources.

    0 讨论(0)
  • 2020-11-22 16:34

    In my case the Maven version of the other referenced project didn't match the version of the test project. Once they were the same, the problem disappeared.

    0 讨论(0)
  • 2020-11-22 16:36

    Evidently, Eclipse does not automatically know where the source code for the dependent jars are. It is not clear why debugger could not inspect variables once the source was attached. One possibility is incorrect/incompatible source.

    Assuming you have a maven project and the sources of the dependencies are downloaded and available in the local repository, you may want to install m2eclipse, the maven eclipse plugin and see if that helps in addressing your issue.

    0 讨论(0)
提交回复
热议问题