Hello friends,

I installed junit4.8.1 in my windows xp, while testing I see following errors.Below are my class path and the location of Junit where I installed. I would really appreciate if some one can help me on this

CLASSPATH =.;C:\Program Files\Java\jre6\lib\ext\QTJava.zip;C:\junit4.8.1\junit4.8.1\junit4.8.1.jar
JAVA_HOME = C:\Java\jdk1.5.0\bin

Junit installation path C:\junit4.8.1\junit4.8.1\junit\tests
when i tried to test my installation from cmd I see below error
Exception in thread "main" java.lang.NoClassDefFoundError: org/junit/runner/Juni
Caused by: java.lang.ClassNotFoundException: org.junit.runner.Junitcore
at java.net.URLClassLoader$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: org.junit.runner.Junitcore. Program will exit.
Can some one please help, I spent quite some time and couldnt figure out the issue
Appreciate your help!!

Did you saved your Class as .java?

When you let it run over cmd using jdk, it would help when you put all your cmd inputs in a notepad and save it as ex.: Run.bat

for example you write in your notepad:
cd Program Files
cd Java
.up to
cd junit4.8.1.jar
set path=C:\Java\jdk1.5.0\bin

javac yourClass.java
java yourClass

then save it as run.bat and try.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.