I installed Eclipse and created a Java project.
Created new Java file outside the 'src' directory and tried to run that.
I got the same error "Editor does not contain a main type".
I just moved the java file into the 'src' folder and could simply run the program.
I couldn't understand what other answers were asking to try. It was so simple.