Setting the classpath

The classpath tells the SDK tools, such as java, javac, and the javadoc tool, where to find the Java™ class libraries.

About this task

Set the classpath explicitly only for these reasons:
  • You require a different library or class file, such as one that you develop, and it is not in the current directory.
  • You change the location of the bin and lib directories and they no longer have the same parent directory.
  • You plan to develop or run applications using different runtime environments on the same system.
To display the current value of your CLASSPATH environment variable, type the following command at a shell prompt:
echo $CLASSPATH

If you develop and run applications that use different runtime environments, including other versions that you have installed separately, you must set the CLASSPATH and PATH explicitly for each application. If you run multiple applications simultaneously and use different runtime environments, each application must run in its own shell.



© Copyright IBM Corporation 2005, 2010. All Rights Reserved.
© Copyright Sun Microsystems, Inc. 1997, 2007, 901 San Antonio Rd., Palo Alto, CA 94303 USA. All rights reserved.
US Government Users Restricted Rights - Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
This information center is powered by Eclipse technology. (http://www.eclipse.org/)