background image
<< Choosing a method to run the Derby tools | Syntax for the derbyrun.jar file >>
<< Choosing a method to run the Derby tools | Syntax for the derbyrun.jar file >>

Setting the environment variables

Getting Started with Derby
12
Method
When to Use
Requirements
up the execution
environment
· You are
developing
application
programs with
Derby
· The CLASSPATH
environment variable
must be set to include the
required JAR files
For details on setting the
CLASSPATH, see
Manually
setting the CLASSPATH
environment variable
.
2. Based on the requirements of the method that you chose to run the tools, follow the
instructions to
set the environment variables
.
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 scripts 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 in a Java program or executing the tools using the
java
command.
The 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 variables.
To set the environment variables:
1. 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 one of the commands in the following
table to set the DERBY_HOME environment variable.
Table 2.
Commands to set the DERBY_HOME environment variable
Operating
System
Command
UNIX (Korn Shell)
export DERBY_HOME=/opt/Derby_10
Windows
set DERBY_HOME=c:\Derby_10
2. Be certain that the
java
executable file, version 1.4.2 or higher, is in your command
execution PATH. Open a command window and run the
java -version
command.
3. Add the
DERBY_HOME/bin
directory to the PATH environment variable so that you
can run the Derby scripts from any directory, as shown in the following table.
Table 3.
Commands to set the PATH environment variable
Operating
System
Command
UNIX (Korn Shell)
export PATH="$DERBY_HOME/bin:$PATH"