# Setting up JUnit on OSX?



## invalidusrname (May 7, 2002)

I was wondering if anyone knows how to set up Junit on OSX. I tried setting up the classpath and everything, but I really need some guidance on the whole installation deal. I try "set classpath=%classpath% ; ~username/junit3.7/junit.jar", but then I get a whole bunch of symbols printed out on the console with no such file directory and permission denied errors. Any info will surely be appreciated


----------



## blb (May 7, 2002)

I've not tried JUnit myself, but judging from your attempt to set the environment (which appears very DOS-influenced), this may help (assuming you're using the default shell tcsh):

```
setenv CLASSPATH ${CLASSPATH}:~username/junit3.7/junit.jar
```
and see if that works.


----------



## invalidusrname (May 8, 2002)

hrm, it says: CLASSPATH: Undefined variable.


----------



## blb (May 8, 2002)

You don't yet have a class path set then; you should simply be able to run

```
setenv CLASSPATH ~username/junit3.7/junit.jar
```
to set it.


----------



## invalidusrname (May 8, 2002)

That did it! Thank you very much


----------



## invalidusrname (May 8, 2002)

hrm.....

~~~~~~~~~~

Installation
Below are the installation steps for installing JUnit: 

1.	unzip the junit.zip file
2.	add junit.jar to the CLASSPATH. For example: set classpath=%classpath%;INSTALL_DIR\junit3\junit.jar
3.	test the installation by using either the batch or the graphical TestRunner tool to run the tests that come with this release. All the tests should pass OK.

Notice: that the tests are not contained in the junit.jar but in the installation directory directly. Therefore make sure that the installation directory is on the class path 

*	for the batch TestRunner type:

    java junit.textui.TestRunner junit.samples.AllTests 

*	for the graphical TestRunner type:

    java junit.awtui.TestRunner junit.samples.AllTests 

*	for the Swing based graphical TestRunner type:

    java junit.swingui.TestRunner junit.samples.AllTests

Important: don't install the junit.jar into the extension directory of your JDK installation. If you do so the test class on the files system will not be found. 


~~~~~~~~~~~~~~~~

ok, now I read this all over. I typed 'setenv CLASSPATH ~username/junit3.7/junit.jar' in the terminal and everything was ok. Once tried to run the test runners though, i get a GUI to pop-up, but at the bottom it says "Class not found "junit.samples.AllTests". I'm assuming this might have something to do with setting the classpath, but i'm not sure.??????


----------

