wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes is classpath an environment variable? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "is classpath an environment variable?" Watch "is classpath an environment variable?" New topic

is classpath an environment variable?

ganapathy gopinathan
Ranch Hand

Joined: Aug 10, 2004
Posts: 30
Hi all,

Anyone plz, help me to know whether the 'classpath' is an environment variable?
if so, what is environment variable?

Thank u,
Peter van der Linden
Ranch Hand

Joined: Sep 28, 2004
Posts: 46
Yes, classpath is typically implemented by an environment variable.

Environment variables are an "operating system thing" not a "java thing".
But they are quite like variables in a programming language.

You give a value to an environment variable using the command line interface,
and the operating system can use the variable instead of a fixed literal value.

For example, there is an env. variable called PATH in most operating systems.
It holds a string of directory names that list the places to look for executable
files when you type a command name at the command line. CLASSPATH was
name as an analogy to this.

See http://en.wikipedia.org/wiki/Environment_variable for more information.

Actually, that Wiki is a great place to search first when questions like this come
into your mind. You'll get a better answer more quickly, and if you can't find or
understand the answer you can always post a more tightly focused question here.



Author of <a href="http://www.amazon.com/exec/obidos/ASIN/0131482114/ref=jranch-20" target="_blank" rel="nofollow">Just Java(TM) 2 (6th Edition)</a>
It is sorta covered in the JavaRanch Style Guide.
subject: is classpath an environment variable?
Similar Threads
Class varible in linux
J2EE newbie; Tomcat Installation Problems: First Servlet
importing Package
HelloWorld NoClassDefFoundError
Exception oin thread "main"