Delete a class but java keeps finding it

1

As the title says, I initially had the class PantallaConsultaPaciente , then I created the class PantallaConsultaPaciente2 and eliminated the previous one, but when I run the application from Eclipse, I still raise PantallaConsultaPaciente , the initial.

I noticed the src of the directory where I have the project hosted and it is not there. I noticed ../bin, and yes that .class was, I deleted it and now I get a long error when I run the application and I want to show the window PantallaConsultaPaciente2 . The error is as follows:

  

Exception in thread "AWT-EventQueue-1" java.lang.NoClassDefFoundError: PatientScreen Patient

I do not know where he keeps bringing him. I'm not instantiating PantallaConsultaPaciente anywhere.

    
asked by Mauricio 06.09.2016 в 16:47
source

2 answers

3

If you are using an IDE such as eclipse or netbeans, give ( project-> clean and then clean all project ) this to eclipse. And if you are in netbeans give right click on the project and the option clean and build . Now notice that the moment you changed your class name it was not being called or instantiated anywhere else, if so, the error is by compilation and you must solve it by placing the new name of the class in the places you are calling it.

    
answered by 06.09.2016 в 17:07
1

That error can occur when you do not use the IDE to rename a class. For example, you have the classes: Clase1 and Clase2 , you eliminate the Clase2 , by means of the IDE, but at Clase1 you select it and you give it F2 , to change the name to Clase2 , and you change the name to the class manually.

But here you did not do a refactor, you can prevent the IDE from marking the error, but you will not tell the JVM that the class needs to be recompiled.

In summary, always delete with the IDE refactor. And it's right you can do a clean or build.

    
answered by 06.09.2016 в 17:59