tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hosahalli, RaghavendraX" <raghavendrax.hosaha...@intel.com>
Subject RE: Classpath???
Date Wed, 17 Jan 2001 18:00:13 GMT
Hi Mick,

"classpath"  is just like "path" in windows. It's used by "jvm(Java Virtual
Machine" to locate the required class files. So when you set "classpath" you
are telling the "jvm" where to search for classes. When "jvm" has to load a
class "x", it checks the classpath environment variable, searches for the
class "x" in all specified directories. But there is a catch, if you have
class "x" in "c:\test1" directory and another class "x" in "c:\test2"
directory and if your classpath says "classpath=c:\test1;c:\test2", "jvm"
picks the first available class. So if it looks into "c:\test1" directory
first, it loads class "x" residing in "c:\test1" directory. So while setting
the classpath you have to make sure that there is no ambugity for the class
you are trying to load, but this rarely happens(having two 
different functionalities under same class name).
Windows:
Now setting the classpath, open a command prompt and type
"set classpath=c:\test1;c:\test2;.;"
each directory should be seperated bu ";"(semicolon)
"." indicates the current directory(from where u r starting ur jvm)this sets
for only that command prompt. so when u close it it goes off. If you need a
global classpath, goto "control panel",select "system", it that you will
have "Environment variables". There create a new environment
variable"classpath" and add required path to it.
In windows environment to check whether a classpath environment variable
exsists,
open a command prompt and type "echo %classpath%" this will show the already
exsisting path

LEt me know if u need more info

-----Original Message-----
From: Mick Sullivan [mailto:micksul@hotmail.com]
Sent: Wednesday, January 17, 2001 9:46 AM
To: tomcat-user@jakarta.apache.org
Subject: Classpath???


Hi all,
What is classpath, i.e. what exactly does it mean.
And how do you set classpath?
Thanks in advance.
Mick
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, email: tomcat-user-help@jakarta.apache.org



Mime
View raw message