Install JUnit, didn't work
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Saturday, May 20, 2006 10:02 PM

After I installed JUnit, I did the following

I set
JUNIT_HOME=C:Program Filesjunit4.1
In the CLASSPATH, I add
%JUNIT_HOME%junit-4.1.jar;

Then I run
java org.junit.runner.JUnitCore org.junit.tests.AllTests

But it's different with what I expected, I got an error "Exception in thread "main" java.lang.noClassDefFoundError: org/junit/runner/JUnitCore". It seems that it can't find the jar file I installed. What probably is the problem? Thanks.

Re: Install JUnit, didn't work

Posted By:   Robert_Lybarger  
Posted On:   Sunday, May 21, 2006 10:20 AM

You didn't say how you set the environment variables (or even what OS you are on, but I'll assume some form of Windows).IF you had a dos prompt already open, and if you then used the control panel / System to set env vars, then that dos window might not get the environment updates. (I've heard sometimes even a new dos window might not be right, but it depends on several mystery factors, so our internal installation documents always tells users to log out and back in after setting env vars.) That being said, at your new dos prompt:
  echo %CLASSPATH%

and make sure it contains the correct location. Also echo out the value of JUNIT_HOME (etc) and make sure the dos prompt is seeing correct values before figuring out your next problem.
About | Sitemap | Contact