Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

setting CLASSPATH

Status
Not open for further replies.

sonun

IS-IT--Management
Dec 26, 2001
384
US
I feel stupid asking this question. Now how is setting CLASSPATH different from setting PATH.
I am playing with java,tomcat, et. al and testing some jdbc code which requires me to,
quote: "All you need to do is to put the JAR file in your CLASSPATH, or unpack the JAR file into a directory in your CLASSPATH"
Please advise.
Thanks.
 
The only difference between setting the CLASSPATH and setting the PATH, is the difference in the name. //Daniel
 
and so is it set the same way ??
is there is .bashrc profile for classpath as there is for path ??
 
Add this line to the end of your .bashrc file
Code:
export CLASSPATH=/var/tomcat
//Daniel
 
At least three things to remember with your CLASSPATH:

1) specifying multiple directories and/or JAR files is done by separating the directories/files with ":" on Unix and Linux systems and with ";" on Win* systems
2) CLASSPATH can be overridden by specifying the "-cp" or "-classpath" command line options to the "java" command
3) you can add JAR files to the $JAVA_HOME/jre/lib/ext directory and have them picked up - automatically - eliminating the need to add these JAR files to your CLASSPATH

I'm sure there's a lot more to say about it, but I thought that might help.

-Rich
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top