eclipse bug（一）Selection does not contain a main type
右键带有main函数的项目时：Selection does not contain a main type
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