aspose file tools*
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 Spring in Action this week in the Spring 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
Author

JUnit 3.8.1 on Red Hat 7.3

Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Hello...

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 http://www.junit.org/index.htm
3. I followed the instructions by unzipping it, and I unzipped it at:
/usr/local/junit3.8.1
the junit.jar was located at
/usr/local/junit3.8.1/junit.jar
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
fi
# User specific environment and startup programs
JUNIT_HOME=$JUNIT_HOME:/usr/local/junit3.8.1/
JAVA_HOME=$JAVA_HOME:/usr/local/java/j2sdk1.4.0_01
J2EE_HOME=$J2EE_HOME:/usr/local/j2sdkee1.3.1
CLASSPATH=$CLASSPATH:.$JAVA_HOME/lib/tools.jar:$JAVA_HOME/jre/lib/rt.jar:$J2EE_HOME/lib/j2ee.jar:$JUNIT_HOME/junit.jar:$JUNIT
PATH=$PATH:$HOME/bin:$JAVA_HOME/bin:$J2EE_HOME/bin
BASH_ENV=$HOME/.bashrc
USERNAME="root"
export USERNAME BASH_ENV PATH JAVA_HOME CLASSPATH J2EE_HOME JUNIT_HOME
--------------------------------------------------
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?
-Unnsse
Frank Carver
Sheriff

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 frankcarver.me ~ 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?
-Unnsse
Frank Carver
Sheriff

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.
 
wood burning stoves
 
subject: JUnit 3.8.1 on Red Hat 7.3