3

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);


}

}
MeMory LEAk99
  • 295
  • 1
  • 6
  • 12

4 Answers4

1

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.

0

This is an Eclipse error message. It seems your installation is corrupted. Try using a fresh installation of Eclipse.

Matthew Farwell
  • 60,889
  • 18
  • 128
  • 171
0

Before trying a fresh install i just restarted eclipse and it did the trick.

David B.
  • 135
  • 1
  • 8
0

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?

Community
  • 1
  • 1
Guymage
  • 1,524
  • 1
  • 14
  • 21
  • Hi, welcome to SO. While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. Thanks. – Cthulhu Apr 04 '16 at 08:52