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?
-
Have you tried updating the project with F5 ? – aleroot Jan 01 '12 at 19:45
-
Thanks aleroot for your answer, but Ive already tried. – intA Jan 01 '12 at 19:52
-
This isn't specific. What do you mean, 'copied'? Copied java files? Copied an entire project inside the IDE? – bmargulies Jan 01 '12 at 19:58
-
I copied the entire project in the IDE. – intA Jan 01 '12 at 20:22
5 Answers
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.

- 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
-
3I 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
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.

- 8,186
- 2
- 45
- 40
-
-
It shows up in the debug perspective when you are debugging code and execution is paused. It shows the execution stack. – Luke Hutchison Aug 13 '19 at 18:00
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 :)

- 400
- 7
- 16
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.

- 353
- 1
- 3
- 14
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.

- 141
- 9