Error: Selection does not contain a main type

I hope you are trying to run the main class in this way, see screenshot:

If not, then try this way. If yes, then please make sure that your class you are trying to run has a main method, that is, the same method definition as below:

public static void main(String[] args) {
    // some code here
}

I hope this will help you.

Leave a Comment