wood burning stoves 2.0
The moose likes Beginning Java and the fly likes Problems installing JUnit on Linux Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Problems installing JUnit on Linux" Watch "Problems installing JUnit on Linux" New topic

Problems installing JUnit on Linux

Steiner Egdal

Joined: Feb 21, 2011
Posts: 4
I am trying to install JUnit to use from commandline on Linux machine.

I have tried to follow the following instructions for an older but similar version of the downloaded package:

Below are the installation steps for installing JUnit:
unzip the junit4.6.zip file
add junit-4.6.jar to the CLASSPATH. For example: set classpath=%classpath%;INSTALL_DIR\junit-4.6.jar;INSTALL_DIR
test the installation by running java org.junit.runner.JUnitCore org.junit.tests.AllTests

Notice: that the tests are not contained in the junit-4.6.jar but in the installation directory directly. Therefore make sure that the installation directory is on the class path
Important: don't install junit-4.6.jar into the extension directory of your JDK installation. If you do so the test class on the files system will not be found.

I have created a folder at /home/me/.junit/ and extracted the zip.file here. In my .bashrc I have

When I do the suggested

I get

And I get a similar error independently of from where I run the command. Any suggestions ?
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14991

Welcome to JavaRanch.

Are you sure the pathname is exactly correct?

When you do: ls -l /home/me/.junit/junit4.2.8 do you see that the file junit-4.2.8.jar is present in the directory?

When you do: echo $CLASSPATH what do you get?

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Steiner Egdal

Joined: Feb 21, 2011
Posts: 4
Dang ! That was an embarassment Seing your reply and reading my own post again, made me realise that I have been typing the wrong directory name into my .bashrc permuting the 2 and 8 in 4.8.2, and looking at it for too long to reveal axactly how long without seeing it! It was the actual copy pasting I gave and it shows my mistake. Thanks, Ill go hide for a couple of days
I agree. Here's the link: http://aspose.com/file-tools
subject: Problems installing JUnit on Linux
It's not a secret anymore!