I had a project that was compiling and running fine. I had also exported the build.xml file without issue. However, today, I clicked Project
-->
Clean...
, and the project will no longer run. It raises the error:
Error: Could not find or load main class com.bar.Foo
Is there any way I can undo this?
Asked
Active
Viewed 718 times
0

Adam_G
- 7,337
- 20
- 86
- 148
-
1Similar question. http://stackoverflow.com/questions/11861303/java-error-in-eclipse-could-not-find-or-load-main-class-length – Laksitha Ranasingha May 12 '13 at 21:58
2 Answers
1
The answer is probably no, you cannot "undo" this. You can probably fix it by building your project, making sure that the project/class exists and that it contains a public static void main(String ... args)
method.

Maarten Bodewes
- 90,524
- 13
- 150
- 263
-
I checked the `build.xml` file, though, and nothing changed. How could that be the case? – Adam_G May 12 '13 at 23:11
-
Check if the class is generated using the "Navigator" view. If it isn't then the build has not been performed. This can be due to "automatic builds" not being enabled, or because the stack of builders has become corrupted (in the project properties there is a "builders" part). – Maarten Bodewes May 13 '13 at 23:11
0
Perhaps the file that you're trying to run was removed from the src
folder.

Steve P.
- 14,489
- 8
- 42
- 72