When you start the project today, and you encounter a situation where the main class cannot be found or cannot be loaded, the project cannot be compiled after it is cleared. Class file does not have a. class file, at least 3 times this problem occurs, and every time the solution is not the same, the problem is marked with a red or exclamation mark on the project, for many reasons are not clear, sometimes the jar is missing or the introduction of useless jar package, the development of software Compile paused slow reaction and so on, today deliberately summed up the way to solve this problem, and share with you:
1.On the SRC folder, right-click-build path-use as Source folders, re-compile, everything is OK.
2.Right-click on the Eclipse project folder to-refresh, recompile, and OK (this method generally does not work).
3.Right-click Properties in the Java Builder Path's libraries label to see if there is a missing or useless (usually with the red difference), the introduction of the corresponding jar or deleted.
4.Set source in properties. Add your Java path. For example SRC, then you need to set the default output folder below, where you set your output path as the class path.
5.Right-click Properties inside the builder inside the project's Builder.xml reference (import) come in.
6.The right-click Properties in the Java Builder path libraries All Delete, especially the JRE, and then, click Save, Close Eclipse, then open, and then the corresponding JRE and lib below the relevant jar introduced, save, recompile after the good , I do not know why, one time I was so ready.
7.If you have a. class file under Class, delete the. class file, and then elipse the menu project-clear and select the item, and then tick build automaticlly (auto-Deploy) from the Project menu below. , and then generate a new class file on the OK.
8.Delete Project. Project below and copy the. project file from your colleague's side of the normal project to refresh the project and try it out.
9.Remove the. Classpath from the project below and copy it from the next item under Normal project. classpath file, refresh the project and try it out.
10.The ultimate solution, and a very useful solution, is to delete the entire project, commit the changes to CVS or SVN before deleting them, and then re-file the project from SVN or CVS.
I am too disgusted with this problem, I hope that one of the above methods will help you, the success of the problem solved!!!
Eclipse Error: Unable to find or load main class or project could not compile 10 kinds of solution Dafa!