Using the command-line tools

JBuilder includes the following command-line tools:

The JDK includes the following command-line tools:

See also: Sun Tools documentation at http://java.sun.com/j2se/1.3/docs/tooldocs/tools.html.

Setting the class path for command-line tools

The class path tells Java tools where to find classes that are not part of the Java platform. You can set the path to the classes with the -classpath option or by setting the CLASSPATH environment variable described in the following topic. The -classpath option temporarily overrides the CLASSPATH environment variable for the current command-line session. It's best to use -classpath as you can set it for each application, and it does not affect other applications.

Directories listed in the classpath are separated by colons on the UNIX platform and by semicolons on the Windows platform. You should always include the system classes at the end of the path. The classpath is also used to search for sources if no sourcepath is specified.

For more information on class paths, see the Java documentation on "Setting the classpath."

For more information on the JBuilder IDE and class paths, see "How JBuilder constructs paths" and "Where are my files?"

Using the -classpath option

UNIX: -classpath option

Use the -classpath option to temporarily set the path to your classes. The -classpath option takes the following form:
% jdkTool -classpath path1:path2

Windows: -classpath option

Use the -classpath option to temporarily set the path to your classes. The -classpath option takes the following form:
C:>jdkTool -classpath path1;path2

Setting the CLASSPATH environment variable for command-line tools

Usually, it's best to use the -classpath command-line option as it only temporarily overrides the classpath and does not interfere with other applications. However, there may be occasions when you want to set the CLASSPATH environment variable.

For more information on the -classpath option and the CLASSPATH environment variable, see the Java documentation, "Setting the classpath."

UNIX: CLASSPATH environment variable

Viewing CLASSPATH
  1. Open a command-line shell window.
  2. View the current CLASSPATH environment using the following command-line format:

Setting CLASSPATH
To set your CLASSPATH environment variable,
  1. Open a command-line shell window.
  2. Set the CLASSPATH environment using the following command-line format:
Clearing CLASSPATH
  1. Open a command-line shell window.
  2. clear the CLASSPATH environment variable using the following command-line format:

Windows: CLASSPATH environment variable

Viewing CLASSPATH
Use the set command to view the current CLASSPATH.
C:> set 
Setting CLASSPATH
To set your environment variables for the command line:

  1. Open a DOS window.
  2. Modify the CLASSPATH environment variable with the set command.

       set CLASSPATH=path1;path2 ... 
    The paths must begin with the drive letter, for example C:\.

Clearing CLASSPATH
If you need to clear your path, you can unset CLASSPATH as follows:
 C:> set CLASSPATH= 

This command unsets CLASSPATH for the current DOS session only. Be sure to delete or modify your startup settings to ensure that you have the right CLASSPATH settings in future sessions.

Changing Startup Settings
If the CLASSPATH variable is set at system startup, the place to look for it depends on your operating system.

Setting the DOS environment space

You might get an Out Of Environment Space error when setting your path, because only a small amount of environment space is allocated by default.

To increase the DOS environment space:

  1. In the DOS window, click the control menu in the upper left, and choose Properties.
  2. Click the Memory tab to show the Memory options page.
  3. In the Initial Environment drop-down list, select a reasonably large value, such as 2048. The other settings on the page can be left at Auto.
  4. Click OK to close the Properties dialog, and type exit at the prompt, to quit the DOS session.
  5. Start a new DOS session.

Note: These instructions apply to Windows 95 and 98 only; they do not apply to Windows NT.