Reputation: 305
I've downloaded Junit version 4.10 and loaded the jar via the build path but I seem to get this error message when running a Junit test in Eclipse:
Error: Could not find or load main class org.eclipse.jdt.internal.junit.runner.RemoteTestRunner
My Test class is the following:
import org.junit.*;
import static org.junit.Assert.assertEquals;
public class InternetConnectTest {
@Test
public void testConnectMethod(){
InternetConnect net = new InternetConnect("www.google.com");
assertEquals("Result", "www.google.com", net.url);
}
}
Upvotes: 3
Views: 10519
Reputation: 1632
I just had the same problem. I relaunch Eclipse with the "-clean" option, and it did the trick too.
Edit: How to run eclipse in clean mode? and what happens if we do so?
Upvotes: 1
Reputation: 135
Before trying a fresh install i just restarted eclipse and it did the trick.
Upvotes: 0
Reputation: 11
I came across this after I updated java versions: "junit: could not load main class 1.1". Go into the eclipse external tools configurations, open the entry for the ant file you are running, then go to the JRE tab, and select "Separate JRE", also making sure your new jre is correctly listed in the Installed JREs...for me, this took care of it.
Upvotes: 1
Reputation: 61705
This is an Eclipse error message. It seems your installation is corrupted. Try using a fresh installation of Eclipse.
Upvotes: 0