Setting the environment variables
There are several environment variables that must be set depending
on the method that you selected to run the Derby tools
and startup utilities.
As mentioned in choosing
a method to run the Derby tools and startup utilities
, you must set
the DERBY_HOME environment variable so that you can use the command examples
that are presented in this manual. Adding the Derby
directory to your command execution PATH makes the scripts easier to use and
enables you to use the script examples in this manual. The CLASSPATH environment
variable must be set if you are using Derby
a Java program or executing the tools using the java
steps below show you how to set the environment variables in a command window.
The settings are only valid for that window. If you close the command window
or open a new command window, you must set the environment variables again.
Tip: You can also set environment variables permanently. For example,
on Windows you can use the Control Panel to permanently set the environment
To set the environment variables:
- Set the DERBY_HOME environment
variable to the location where you extracted the Derby bin distribution.
For example, if you installed Derby in
the /opt/Derby_10 directory
on UNIX or in the c:\Derby_10 directory
on Windows, use the following command to set the DERBY_HOME environment
- Be certain that the java.exe file, version 1.4.2
or, higher is in your command execution PATH. Open a command window and run
the java -version command.
- Add the DERBY_HOME/bin directory
to the PATH environment variable so that you can run the Derby scripts
from any directory.
If you use the Control Panel to update your system PATH, add %DERBY_HOME%\bin to the
end of the PATH environment variable
Tip: When the DERBY_HOME environment
variable is set and the underlying /bin directory is included
in the PATH environment variable, you can use shortened commands to start
the Derby tools. Otherwise,
either you must be in the directory where the script that starts the Derby tool
is located, or you must specify the full path to the location of the script
when you want to start the tool.