User's Guide - Setting the CLASSPATH

NetRexx User's Guide, version 2.02 Copyright (c) IBM Corporation, 2001. All rights reserved. © | Draft of 22 May 2001
[previous | contents | next]

## Setting the CLASSPATH

Most implementations of Java use an environment variable called CLASSPATH to indicate a search path for Java classes. The Java Virtual Machine and the NetRexx translator rely on the CLASSPATH value to find directories, zip files, and jar files which may contain Java classes.

The procedure for setting the CLASSPATH environment variable depends on your operating system (and there may be more than one way). Here are some examples:

- For most Windows installations, or for OS/2, use a `SET CLASSPATH=` command in AUTOEXEC.BAT (for Windows) or in CONFIG.SYS (for OS/2), and then re-boot after changing. In both cases the command syntax is the same, and might look like this:

        set classpath=.;c:\java1.2\lib\NetRexxC.jar

  In this example, the first segment of the value (before the semicolon) lets classes in the current directory be found, and the second segment includes the classes needed by the NetRexx translator. Both environments normally include the standard Java classes automatically. Under Java 1.2, you may need to add the Sun tools classes explicitly (in tools.jar, see above).
- Under Windows NT 4.0 and Windows 2000 the CLASSPATH should be set using Start, Settings, Control Panel, System, Environment tab, System Variables, and clicking on CLASSPATH; new command windows will then inherit the new setting immediately.
- For Linux and Unix (BASH, Korn, or Bourne shell), use:

        CLASSPATH=<newdir>:$CLASSPATH
        export CLASSPATH

  Changes for re-boot or opening of a new window should be placed in your `/etc/profile`, `.login`, or `.profile` file, as appropriate.
- For Linux and Unix (C shell), use:

        setenv CLASSPATH <newdir>:$CLASSPATH

  Changes for re-boot or opening of a new window should be placed in your `.cshrc` file.

If you are unsure of how to do this, check the documentation you have for installing the Java toolkit.

[previous | contents | next]