1000 Java Tips ebook
Free "1000 Java Tips" eBook is here! It is huge collection of big and small Java
programming articles and tips. Please take your copy here.
Take your copy of free "Java Technology Screensaver"!.
How can I check CLASSPATH variable on my OS?
JavaFAQ Home » General Java
Question: How can I check CLASSPATH
variable on my OS?
Answer: The CLASSPATH environment
variable tells the Java Virtual Machine and other Java applications where to
find all the class libraries.
User-defined class libraries also defined by the CLASSPATH variable.
Open Command prompt in Windows
and type: echo %CLASSPATH%
In Linux, Unix or MAC OSX in any shell: echo $CLASSPATH
Default class path
If the CLASSPATH environment varialbe is not set, the following default
class path will be used:
All the entries in this line are ":" separated...
represents the current directory. The symbol
[bin] stands for the
absolute path to the
jdk1.1.x/bin directory. Therefore, if you keep
lib directories at the same directory
level, the Java executables will find the JDK classes (contained in the
classes.zip file). Note that the default class path also includes a path
classes directory on the same directory level as
lib. You can put your own (unzipped) class files in a
classes directory that you create, and the Java executables will be able
to find them with the default CLASSPATH.
Setting your CLASSPATH: fast receipt here!
You need to set the CLASSPATH if you move the JDK's
file or if you want to load a class library that's not in a location specified
by the default CLASSPATH. To set CLASSPATH, use the setenv command.
And you unset your CLASSPATH in just one short command like this:
You need unset if your CLASSPATH environment variable has been set to a value that is not correct, or if your startup file or script is setting an incorrect path.
This command unsets only CLASSPATH's current value. You should also delete or
modify the lines in your startup file that may be setting an incorrect
Printer Friendly Page
Send to a Friend
Search here again if you need more info!