You can set the CLASSPATH environment variable in the operating
system either temporarily, permanently, or at run time when you start your
Java application and the JVM.
In most development environments, it
is best to temporarily set the CLASSPATH environment variable in the command
line shell where you are entering commands. provides
several scripts in the /bin directory
to help you set your classpath quickly. These scripts are:
- setEmbeddedCP
- The setEmbeddedCP script adds the derby.jar and derbytools.jar
files to the classpath, when the database engine is used in embedded mode.
- setNetworkServerCP
- The setNetworkServerCP script adds the
derbynet.jar file to the classpath, so that you can start the network server.
- setNetworkClientCP
- The setNetworkClientCP script adds the derbyclient.jar
and derbytools.jar files to the classpath, so that you can access databases
using the network client.
To set the classpath temporarily, run the script that
is appropriate for your environment every time that you open a new command
window.
To see the classpath that the script sets, issue the following
command after you run the script:
- On UNIX, use echo $CLASSPATH
- On Windows, use echo %CLASSPATH%