Eclipse: editor does not contain a main type java

Problem:
Eclipse give “editor does not contain a main type” error when you start a class with contain a valid main method.

I know if I enable Maven dependency, that Eclipse will not be able to find the main method. Is it possible to take a class out of the classpath (java.build.path) if it is in the default directory?

Solution:
I had the same problem, I have to add that file to build path. after adding that file to build path. It worked fine. Go to package explorer –> build –> Add to build path || Include. This will solve the issue

Leave a Reply

Your email address will not be published. Required fields are marked *