[Webinar] Streamline your web hosting managementRegister Today


how do I set the classpath for java jar files

Posted on 2000-01-28
Medium Priority
Last Modified: 2010-04-22
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
Question by:unomateo

Accepted Solution

s_franklin earned 150 total points
ID: 2412261
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:



Author Comment

ID: 2432981
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.


Expert Comment

ID: 5573803
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

Featured Post

Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The purpose of this article is to fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
Is your organization moving toward a cloud and mobile-first environment? In this transition, your IT department will encounter many challenges, such as navigating how to: Deploy new applications and services to a growing team Accommodate employee…
Free Data Recovery software is an advanced solution from Kernel Tools to recover data and files such as documents, emails, database, media and pictures, etc. It supports recovery from physical & logical drive after a hard disk crash, accidental/inte…
Suggested Courses
Course of the Month8 days, 19 hours left to enroll

590 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question