Eclipse Debug: Source Not Found while remote debugging

30,287

Solution 1

In this scenario just follow the following steps:

  1. Go to Run → Debug Configurations
  2. Select the remote application configuration being debugged.
  3. Select the second tab named 'Source'
  4. Now add the folder/projects containing the source code explicitly here.

Solution 2

In the Java build path for the project, under the sources tab, check if your class path is under the included list. If its under the excluded list, remove it from there.

Solution 3

As Saury said, get your debug configuration right. When remote debugging, often developers have selected the wrong project while creating a new configuration. Verify you select the project you wish to debug and it corresponds to the version of the deployed WAR/EAR/JAR in the appliation container.

Solution 4

Follow the next steps in case you use a parent project connected to sub-project/s:

Use the 'Debug Cofigurations' source tab or the 'Edit Source LookUp path' option to attach the sources of the running code.

Note: you'll need to attach the src folder of your inner project rather than the target in order to make it work (check the screenshot below).

E.g.

enter image description here

An update for eclipse Oxygen (Feb 2018):

Attaching the Java projects (sub projects) also worked well; e.g:

enter image description here

Solution 5

I ran into a similar problem. It turns out I was missing the devel package on CentOS.

In my particular case, the following yum statement solved the problem.

yum install java-1.7.0-openjdk-devel
Share:
30,287
Stealth
Author by

Stealth

Updated on July 09, 2022

Comments

  • Stealth
    Stealth almost 2 years

    In my Java eclipse project, while I am remote debugging, eclipse does not step into the class files of imported library files even though the source file jars are properly mapped to the library files.

    Instead it gives me a "Source Not Found" error. But when I am editing the same class in eclipse, I can control-click a class or method name and it takes me to the correct library class file.

    Can anyone please tell me what I am doing wrong?

    I am using Tomcat 6 and latest Eclipse Java EE.

  • Stealth
    Stealth over 12 years
    I did that. But it still gives me the same "Source not Found" and below it, it gives "Edit Source LookUp path" button.
  • Saurabh
    Saurabh over 12 years
    There is a checkbox also (please pardon me as I am not sure) which says that include duplicate files/paths something. Try by checking that true too also and see if it works.
  • Marco Leo
    Marco Leo almost 12 years
    I am having the same problem, but it still doesn't work after checking the checkbox, i can see le vaules in the debug prospectiive, but it can't find the source, can you help me?
  • RoboAlex
    RoboAlex almost 12 years
    Start the java application with java -agentlib:jdwp=transport=dt_socket,server=y,address=8000 org.iforge.aectann.DebugMe option not with java -Xdebug -Xrunjdwp:transport=dt_socket,address=8001,server=y suspend=y -jar stockTradingGUI.jar options
  • Javatar
    Javatar over 10 years
    Where are the source files for dependency .class files stored?
  • gstackoverflow
    gstackoverflow over 9 years
    But If I have bin only(not sources) ?
  • ram
    ram over 5 years
    When you are so sure of all the above 4 steps + Checking include duplicate files/paths, Do a restart of Eclipse