File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Linux / UNIX and the fly likes Setting classpath in linux. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Linux / UNIX
Bookmark "Setting classpath in linux." Watch "Setting classpath in linux." New topic

Setting classpath in linux.

Andrew Stallard
Ranch Hand

Joined: Mar 06, 2010
Posts: 33
I have RedHat Linux, and I want to set the classpath for my junit utility. According to your faq I should have a file called .bash_profile in my home directory. However, I can't find it anywhere. In addition, I tried creating this file in my home directory and running it as a shell script. I tried:

This does nothing. How can I do this?

Thank You for Responding

Andrew Stallard
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17410

I don't set CLASSPATH in my $HOME/.bash_profile. Which is a file you'll only have if bash is your command shell. ksh and csh have their own login scripts.

The reason I don't set CLASSPATH there is that usually I set classpaths on a per-program basis.

However, my bash profile does set JAVA_HOME and adds JAVA_HOME/bin to the PATH. Also ANT_HOME and MAVEN_HOME.

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: Setting classpath in linux.
It's not a secret anymore!