Eclipse Debug - Classes with equal names in different projects

Asked

Viewed 277 times

0

I was debugging here and I came across a curious situation. I already fucked, but I could not succeed in discovering the problem.

On a project, I have the class EntidadeDAO in the project1. In another project, in the same Workspace, I have a class with the same name, EntidadeDAO, in the project2. When debugging the project1, in this class, the eclipse points to the class of the project2.

Obs: The two classes are quite different, only the names are equal. Only the same names. The project name and packages are all different.

Someone else has been through this and can tell me why?

Edit: I’m using Eclipse Neon, I forgot to warn.

  • 1

    Could be the import of EntidadeDAO point to project two. How did you add this class to the project? as normal file or library?

  • is in the same package, the package faturamento;

  • 1

    Even if project 2 is closed, does that happen? See also if project 1 has no reference to project 2. Check the build path.

  • No, there is no reference to the other project in the build path.

  • I didn’t try to close it.

1 answer

2

This problem occurs because in the eclipse debug configuration the project1 is first than project2, this is kind of an eclipse bug itself and a lot of people who have classes that have the same name in several projects have this problem from time to time, I’ve already managed to solve this in two ways:

Option 1: Change the Source Lookup order in debug.

inserir a descrição da imagem aqui

Next

inserir a descrição da imagem aqui

2nd Option: Instead of changing the order remove one of the Source Lookup projects temporarily

  • Thanks man!!! I checked Run/Debug Settings, where you have the list of classes that are in Debug and I found another solution. launch configuration properties class and aim for the project I want and the class I want.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.