# Starting ij

Derby provides batch and shell scripts for users in Windows and UNIX environments that can be used to start ij. By calling the appropriate script you will start ij and be able to connect with a simple command. The scripts are found in the `bin` directory of your Derby installation. You can also customize the ij scripts to suit your environment.

If you are using Derby as a client/server environment, start the Network Server before connecting to the Derby database. (See "Starting the Network Server" in the Java DB Server and Administration Guide for details.) You can start ij by running the ij scripts for your environment. Follow the instructions in "Setting up your environment" in Getting Started with Java DB to set the `DERBY_HOME` and `JAVA_HOME` environment variables and to add `DERBY_HOME/bin` to your path. Then use the following command:

    ij [-p propertyFile] [inputFile]

Alternatively, set the `DERBY_HOME` environment variable, then use one of these commands:

    (UNIX) java [options] -jar $DERBY_HOME/lib/derbyrun.jar ij
        [-p propertyFile] [inputFile]

    (Windows) java [options] -jar %DERBY_HOME%\lib\derbyrun.jar ij
        [-p propertyFile] [inputFile]

    java [options] org.apache.derby.tools.ij
        [-p propertyFile] [inputFile]

If you use the last form of the command, be sure that derbyrun.jar is in your classpath (for pre-10.2 distributions derbytools.jar and usually derby.jar were required in the classpath).

The command line items are:

- `java`

  Start the JVM.

- `options`

  The options that the JVM uses. You can use the -D option to set ij properties (see Starting ij using properties) or system properties, such as Derby properties.

- `propertyFile`

  A file you can use to set ij properties (instead of the -D option). The property file should be in the format created by the java.tools.Properties.save methods, which is the same format as the derby.properties file.

- `inputFile`

  A file from which to read commands. The ij tool exits at the end of the file or an exit command. Using an input file causes ij to print out the commands as it runs them. If you reroute standard input, ij does not print out the commands. If you do not supply an input file, ij reads from the standard input.

For detailed information about ij commands, see ij commands and errors reference.

Parent topic: Using ij
Related concepts
Getting started with ij
Related tasks
Creating a database using ij
Starting ij using properties