I have a Java project in Eclipse with several classes and a bunch of debug configs to test them. Up until today debugging was working fine. I just tried debugging one of the configs and got Error: Could not find or load main class
. Same problem with the other configs. I also have an ant
build.xml
file that I run that exports a JAR. This JAR ran fine outside Eclipse with the class I wanted to debug. Read up on this here and here and tried a few things that were suggested there but none helped. Cleaned the project; checked that "java builder" is picked under project builders; checked .classpath
. Nothing suspicious.
Trying to remember what happened between the last time I debugged and now. One thing stands out: out sysadmin rebooted my (RedHat) machine while I was working in Eclipse (thanks dude!). I did not see any error messages when I restarted Eclipse but could this have messed things up that can't be fixed by simply cleaning the project?
Whether or not that was the reason, what else can I check/try to get this to work again?
UPDATE: I found a way to get this to (sort of) work, but it feels more like a workaround rather than a solution since I still don't know what the problem is. What I did was I:
- Made a copy of my project dir (
cp -r Proj Proj2
) - Deleted everything from
Proj2
except forsrc/
,lib/
andbuild.xml
- Created a new Java project in eclipse and pointed it to
Proj2
- Also modified
Proj2/build.xml
to refer toProj2
instead ofProj
-- this isn't really relevant to the original issue, but I am listing it for completeness
The result is that debugs work in Proj2
, but they still don't in the original Proj