Eclipse is creating two class files

class, eclipse, java, refresh

Solution

So I had this same problem and it may be for the same reason. The problem can be because you are creating the .java files in the Project Explorer window. Close this window. Then, go to Window -> Show View -> Package Explorer. Then create your .java files there. The issue is that the Project Explorer window looks EXACTLY the same way as the Package Explorer.

Problem

When I create a new class inside a package for some reason it creates two class files: one inside of the package and one out of it. I wanted to know why this is happening? Also, at times, Eclipse are kind of "hiding" some of my classes, so that they do not appear in the project explorer, although when you create a new class file with the same name of the class that disappeared, it says the class already exists... When I refresh (F5) the package, these problems are sort of solved. But they happen again when I create a new class or when I restart Eclipse. So I wanted a different solution from keep pressing F5 everytime...

Original source