I am trying to run some java files in a new project. So I make the project, put the files in it and I try to run the main file so my game starts.
I get an error that says selection does not contain a main type
.
I have tried several ways to run it:
- Some say to launch eclipse again, tried this a dozen times.
- Somewhere else someone pointed to open a new project and make a build path to the old project.
Didn't work either.
I am pretty sure it must work because I ran it a few hours ago at school. How do I get this working? Thank you in advance!
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:
I hope this will help you.