12

I copied an Eclipse Java project and tried to run the debugger on the copied version. The debugger used the code of the old project. What can I do in this situation?

Pops
  • 30,199
  • 37
  • 136
  • 151
intA
  • 497
  • 2
  • 10
  • 23

5 Answers5

16

Have a look at the launch configuration that you are using to start the debugger. In the Package/Project explorer, do right-click Debug As.. and then select Debug Configurations and make sure all of the details of the launch configuration you are using line up with your new project.

Francis Upton IV
  • 19,322
  • 3
  • 53
  • 57
  • Ok, your advice leaded me to the solution, to delete the original project from the listed debug configs - now it works. Thanks! – intA Jan 01 '12 at 20:25
  • 3
    I ended up at this question after searching for a slightly different problem. Eclipse couldn't find the attached source for some code I was debugging, and I accidentally selected the wrong target in the "Source Attachment Configuration" dialog box. The "Source" tab under Debug Configurations was the place to undo that mistake and set the proper location. – Pops Oct 12 '12 at 22:54
8

Right-click on the top frame in the debugger's stack view, and select "Edit source lookup...". Remove the incorrect source entry from the list, and/or add the correct one.

Luke Hutchison
  • 8,186
  • 2
  • 45
  • 40
0

One thing you can do is to link your server project src folder to your current project.

This could be done as follows:

Right click on project B --> Properties --> Java Build Path --> Source --> Link Source --> Browse, then locate the A project src. Finally change the Folder name field as you wish.

I hope this helps :)

mor222
  • 400
  • 7
  • 16
0

I had the same problem. Going into the Debug Configurations as per Francis Upton's answer it all looked fine, but I still had the same problem.

Restarting Eclipse fixed it.

Bandjalong
  • 353
  • 1
  • 3
  • 14
0

in my case, I have 2 project (A and B) that is referring different version of C. Say A is referring C version 1, and B is referring C version 2. When I am debugging A, C version 2 's source came up always, not C version 1. I ends up adjust the order in debug configuration by remove project B and re-add it. I made project A ahead of project B. That solves the problem.

iamcoming
  • 141
  • 9