[eclipse] Editor does not contain a main type

Have faced the similar issue, resolved this by right clicking on the main method in the outline view and run as Java application.