Hello all friends, I have a problem with installation of Junit I've done this job : ===================== - Downloaded Junit , unziped it , put it under : c:\junit3.8.1 - in my windows xp , i've added a new entry in "environment variable" entry name : CLASSPATH value : c:\junit3.8.1\junit.jar - i tried to run sample test using the dos prompt C:\junit3.8.1>java junit.textui.TestRunner junit.samples.AllTests
I get this result : ------------------- 'java' is not recognized as an internal or external command, operable program or batch file. i think it may be a simple problem concerning with classpath , but it really took alot of time from me . i really appreciate any help Thanks in advance
Hesham Katon<br />SCJP 1.2<br />SCWCD 1.4<br />Better to light a candle than to curse the darkness
Joined: May 29, 2003
Hesham, You haven't correctly set the PATH variable on your XP box. Once you do that you shouldn't have any problems. You need to include your "bin" directory of your J2SE installation in it.
dear Nathaniel, I am really thankful for your reply . I've tried to add j2se path , but i think i am still do it in the wrong way . I made it like this : in the system variable section : variable name : CLASSPATH variable value : c:\j2sdk1.4.2_03\bin;c:\junit3.8.1\junit.jar and this still doesnt work . i wish you can tell me exactly what is the wrong in the classpath thank you very much
Joined: May 29, 2003
Kesham, You are confusing your classpath with your executable path. One is a Java issue; one is a Windows XP issue. The two are different.
Hello Thank you very much . I think i've solved the problem with java path but i am still have another problem . Now when i am trying to run this code : java junit.textui.TestRunner junit.samples.AllTests i got this result : Class not found "junit.samples.AllTests" i think this is related with junit not java path , right ? I have already added junit to the CLASSPATH like this : C:\j2sdk1.4.2_03\lib\tools.jar;c:\junit3.8.1\junit.jar isn't this right ?
Joined: Jan 23, 2002
The reason why the JVM doesn't find the "junit.samples" stuff is that those packages are not inside the junit.jar file. In my JUnit 3.8.1 distribution, those classes are located in "C:\apps\junit-3.8.1\junit\samples\AllTests.class". In other words, you need to add the "C:\apps\junit-3.8.1" directory as an entry into your classpath.
this is finally done i want to thank all of you very much Thanks to Nathaniel Stoddard , Jeanne Boyarsky , & Lasse Koskela your replies were really helpful
Joined: Feb 15, 2005
I have also setup junit for the first time, and my rekated environment variables are:
CLASSPATH = %JUNIT_HOME%\junit.jar;%JUNIT_HOME%
JUNIT_HOME = C:\junit3.8.1
Path = %SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\ATI Technologies\ATI Control Panel;C:\Program Files\Perforce
and now i am able to run
Any ideas ?
Joined: Jan 30, 2004
If I were you guys, I would use a build tool like ant or an IDE like Eclipse (which has junit built in) to run the examples, instead of using cmd line. Trying to clean up your PATH and CLASSPATH variables that WIN XP sets is a pain. You may find that every java app server (and even applications) you install has its own JVM and resets those variables. Just use the tools!
SOK Pongsa Metrey SOK
Joined: Jul 27, 2006
Thanks very much, Coz of your chatting, I also can configure my JUnit 3.8.1 that the program was the same, now it is fixed.