my dog learned polymorphism
The moose likes Linux / UNIX and the fly likes JUnit 3.8.1 on Red Hat 7.3 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "JUnit 3.8.1 on Red Hat 7.3" Watch "JUnit 3.8.1 on Red Hat 7.3" New topic

JUnit 3.8.1 on Red Hat 7.3

Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511

I have been having trouble installing JUnit 3.8.1 on my Linux distribution, Red Hat 7.3, in particular.
Here's what I did:
1. I logged into Red Hat 7.3 as root
2. I downloaded JUnit3.1.8 frpm
3. I followed the instructions by unzipping it, and I unzipped it at:
the junit.jar was located at
The instructions told me to append/add the junit3.8.1 directory and the junit.jar file to my CLASSPATH, so I did this:
cd /root
vim .bash_profile
and added accordingly (this is what my .bash_profile looks like):
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
# User specific environment and startup programs
And when I try to test it by typing in the following on the command line:
java junit.textui.TestRunner junit.samples.AllTests
It printed:
Exception in thread "main" java.lang.NoClassDefFoundError: junit/textui/TestRunner
Can anyone help me with this problem?
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
I hope this is not too simplistic an answer, but I notice that you didn't say that you logged back in or re-ran your ".bash_profile".
Changes to these "startup" files are not picked up automatically, you need to re-run them which is most simply done by logging in on another virtual console (or console window if you use X).
Are you still having the problem ?
[ December 04, 2002: Message edited by: Frank Carver ]

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Yes, I am still having the problem... I mean, I have it set the same way on Windows 2000 Professional and JUnit and Ant work fine. On Linux, the only thing that doesn't work is JUnit, and as you can see I have it appended to my classpath...
And I did login as another user and did log out and re-login as root and it still didn't work. Does anyone have any JUnit testing experience in a UNIX or Linux environment? Where would be the best place on the JavaRanch Big Moose Saloon to post questions, regarding JUnit?
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
I've just looked at your setup in mode detail, and I think I have spotted the problem. You seem to be treating the "HOME" environment variables as if they are paths (prepending the existing value, and so on). These variables are not paths, but just the names of directories. Try something more like this:

Let us know how you get on.
I agree. Here's the link:
subject: JUnit 3.8.1 on Red Hat 7.3
It's not a secret anymore!