File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
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 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="" target="_blank" rel="nofollow">Just Java(TM) 2 (6th Edition)</a>
I agree. Here's the link:
subject: is classpath an environment variable?
It's not a secret anymore!