Eclipse debugging stopped working: Could not find or load main class

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 for src/, lib/ and build.xml
  • Created a new Java project in eclipse and pointed it to Proj2
  • Also modified Proj2/build.xml to refer to Proj2 instead of Proj -- 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

Replay

The answer based on my comment.

Check, whether bin is set as output folder:

Eclipse debugging stopped working: Could not find or load main class

if so and it seems "unused" - it might be, that Eclipse have some problem cleaning it - do the clean manually and try clean and rebuild (if you have "build automatically" set, just perform clean from eclipse) and check, that the classes are in bin...

Eclipse debugging stopped working: Could not find or load main class

Category: java Time: 2016-01-26 Views: 0

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.123 (s). 12 q(s)