Easy to Learn Java: Programming Articles, Examples and Tips

Start with Java in a few days with Java Lessons or Lectures


Code Examples

Java Tools

More Java Tools!

Java Forum

All Java Tips


Submit News
Search the site here...
Search the JavaFAQ.nu
1000 Java Tips ebook

1000 Java Tips - Click here for the high resolution copy!1000 Java Tips - Click here for the high resolution copy!

Java Screensaver, take it here

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 Go to all tips in General Java

Bookmark and Share

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...

The dot, ., represents the current directory. The symbol [bin] stands for the absolute path to the jdk1.1.x/bin directory. Therefore, if you keep the bin and 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 to a classes directory on the same directory level as bin and 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 classes.zip 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:

   unsetenv CLASSPATH
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 CLASSPATH.
 Printer Friendly Page  Printer Friendly Page
 Send to a Friend  Send to a Friend

Bookmark and Share

Search here again if you need more info!
Custom Search

Home Code Examples Java Forum All Java Tips Books Submit News, Code... Search... Offshore Software Tech Doodling

RSS feed Java FAQ RSS feed Java FAQ News     

    RSS feed Java Forums RSS feed Java Forums

All logos and trademarks in this site are property of their respective owner. The comments are property of their posters, all the rest 1999-2006 by Java FAQs Daily Tips.

Interactive software released under GNU GPL, Code Credits, Privacy Policy