Java Eclipse error method not found in class

Applesire Jon picture Applesire Jon · Oct 29, 2013 · Viewed 19.6k times · Source

The error states Error main method not found in class. Please define the main method as: public static void main(String[] args).

Eclipse was working for me a few days ago, but now it just gives me that message

an example would be

public class Test {
    public static void main(String[] args) {
        // TODO Auto-generated method stub
        System.out.println("Hello World");
    }
}

Answer

Plinio FM picture Plinio FM · Feb 13, 2014

Check if exists any error in your project. Not just the compilation errors. Click on project and check the "Problems" view in Eclipse. You need to remove all of "Errors".