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.
解决方案(二):
if you are still having a problem you might not have your class inside the src folder in which case Eclipse may not see it as part of the project. This would also invoke the same error message you have seen.
Right click on the folder where you put your main class then click on Build Path --> Use as Source Folder
eclipse bug(一)Selection does not contain a main type
右键带有main函数的项目时:Selection does not contain a main typeI 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 ...