Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Newcomers » Newcomers » Problem with JUnit4 and Eclipse
Problem with JUnit4 and Eclipse [message #1171668] Tue, 05 November 2013 11:55
Nick Bar is currently offline Nick BarFriend
Messages: 1
Registered: November 2013
Junior Member
Hello all!

I am trying (unsuccessfully) to get JUnit to work. I have a Java project with just one class (called MyClass) that has only one function named multiply (i.e. simple stuff).
I create a test class to do the unit testing (Right Click -> New -> JUnitTestCase etc ... ), a test class is automatically created however when I "Run As -> Junit Test" I always get the following error:

Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jdt/internal/junit/runner/RemoteTestRunner
Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.junit.runner.RemoteTestRunner
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)


I know this must be something trivial and has to do with library dependencies, however JUnit4 is already included in the build path (Project -> Properties -> Java Build Path -> Libraries)!

What I have tried so far (based on solutions I found on Google) :
- Double-checking that JUnit4 is in the build path.
- Manually adding JUnit4 to build path
- Cleaning and rebuilding my project
- Use of JUnit3 stead of JUnit4
- Go to Order and Export (Project -> Java Build Path -> Order and Export) and check JUnit4.
- Re-installing Eclipse(!)

No matter what I try, I always get the same error. Any ideas?


P.S. I don't think it matters, but I run Eclipse IDE for Java Developers on a Mac (Maverick).
Previous Topic:Error message on start up
Next Topic:[eclipse's installation on ubuntu]An error has occurred. See the log file
Goto Forum:
  


Current Time: Sun Apr 18 00:46:53 GMT 2021

Powered by FUDForum. Page generated in 0.03675 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top