Written in front of the words: I also appear this problem, but the solution and forwarding the content is not the same, the principle is the same, I am right click Src--build path--use as source folder, and then remove source folder on the line, remember to run after the restart, And the package is estimated to rebuild source again.
Today, with Eclipse, when you intend to run a class with the main function, an error box appears editor does not contain a main type.
Eclipse/myeclipse There is a main function class running an error: Editor does not contain a main type
Workaround: In the Package Explorer on the left, right-click the directory at the top level of this class's package--build Path--use as source folder. That will solve the problem.
This problem occurs because the package that contains the Java file is not identified by MyEclipse as the source package. The processing method is as follows:
1. Open the Java Build Path window and select the source interface:
2. Click Add Folder, select the root package of the class in the dialog box, and the latter point determines:
3. After clicking OK and waiting for the workspace to build, the project looks like the following figure, which is success:
5. The file entrainment "field" icon is successful, now, you can run the main way to change the class.
Finally, explain what is called "in Build Path." You can understand that, in eclipse, classes in the build path can be compiled and run, and profiles can be read and written directly by classes in relative paths.