# Choosing a method to run the Derby tools and startup utilities

There are several ways that you can run the Derby tools and startup utilities.

The method that you choose to run the tools and utilities determines the environment variables that you set for Derby.

1. Choose the method that you want to use. The methods are listed in the following table.

   Table 1. Methods of running the Derby tools and utilities
   Method | When to Use | Requirements
   --- | --- | ---
   Run the tools using the command shell scripts that are provided with Derby. | Use this method when you want to run the tools with the least amount of typing and have installed the full `bin` distribution of Derby. | Set the DERBY_HOME environment variable Include the location of the `java` executable file (usually `JAVA_HOME\bin`) in the PATH environment variable Include the `DERBY_HOME\bin` directory in the PATH environment variable
   Run the tools using the `derbyrun.jar` archive file. | Use this method when: You have only the Derby jar files available (see Libraries provided by Derby), and do not have the full `bin` distribution of Derby You do not want to use the scripts that are provided with Derby | Set the DERBY_HOME environment variable Include the location of the `java` executable file (usually `JAVA_HOME\bin`) in the PATH environment variable The `derbyrun.jar` file must be in the same folder as the other Derby .jar files. For more information, see Syntax for the derbyrun.jar file.
   Run the tools using the complete `java` syntax, or use Derby in a Java program. | Use this method when: You do not have the `derbyrun.jar` file or the Derby scripts installed You want to learn the full syntax of each command and understand the details of setting up the execution environment You are developing application programs with Derby | Set the DERBY_HOME environment variable Include the location of the `java` executable file (usually `JAVA_HOME\bin`) in the PATH environment variable You must know the full package name for the Java class that supports the tool 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.

Parent topic: Setting up your environment