Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse Debug: Source Not Found while remote debugging

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.

like image 735
Stealth Avatar asked Oct 10 '11 18:10

Stealth


People also ask

How do I enable debugging in Eclipse?

A Java program can be debugged simply by right clicking on the Java editor class file from Package explorer. Select Debug As → Java Application or use the shortcut Alt + Shift + D, J instead.


3 Answers

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.
like image 192
Saurabh Avatar answered Nov 08 '22 12:11

Saurabh


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.

like image 2
Benny Avatar answered Nov 08 '22 11:11

Benny


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.

like image 2
feder Avatar answered Nov 08 '22 12:11

feder