how do I set the classpath for java jar files

I just unziped the xml parser from sun, and I need to set the classpath for the File: jaxp.jar.
I pretty sure I have to edit the .bash_profile but I can't get it to work, please help.

I can get it to work by using -classpath as an argument but I want it to be able to find the classes all the time.

Also I am using Bash
Please Help
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

export CLASSPATH="/path1/dir1;/path2/dir2;/path3/dir3"

Normally your classpath consists _at least_ of your JDK classpath, but you may have additional paths to special stuff you have written yourself, additional JDBC drivers, etc. It shoulds like you already know what your classpath should be since you're defining it on the javac/java command line. So, stick that argument in the instruction above and you should be fine.

Don't create spaces between CLASSPATH=", and you can verify that you have created the path properly by doing:



Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
unomateoAuthor Commented:
I did some reading on the classpath subject. The first time I tried the new setting for classpath, it didn't work. then I found out you have to also enter classpath on the export line in the samefile too. Don't forget that.

If u want your jar files to be used as your JDK extension in Windows environment simply copy jar files in following directory
of jre


it will work fine
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux OS Dev

From novice to tech pro — start learning today.