NonStop Server for Java 6.0 Programmer's Reference

Setting Environment Variables
The following subsections describes the variables that define the environment in which Java operates.
PATH
The environment variable PATH enables Open System Services (OSS) to find the Java executable
files. As a convenience so that you do not have to fully qualify the Java executable, add the absolute
path of the java/bin directory to the PATH environment variable.
To add the absolute path, use this command:
export PATH=/install_dir/java/bin:$PATH
where install_dir is the directory in which the NonStop Server for Java 6.0 is installed. By
default, this is /usr/tandem.
The PATH shell variable must be created in each shell in which you plan to run java or one of its
tools. For this reason, it is a good idea to set the PATH in the .profile file in your home directory
that is executed each time you logon to an OSS shell. See the Open System Services User's Guide
for information on how to set the path in your startup file.
Class Path
The class search path (more commonly, class path”) is the path that the Java runtime environment
searches for classes and other resource files. The class path tells the JDK tools and applications
where to find third-party and user-defined classes. The class path can be set either by using the
-classpath option when calling a JDK tool (such as, java or javac), or by setting the
CLASSPATH environment variable.
The preferred method is using the -classpath option because you can set that option individually
for each application without affecting other applications and without other applications modifying
the option's value.
Syntax
jdkTool -classpath classpath1:classpath2...
-or-
export CLASSPATH=classpath1:classpath2...
jdkTool
A command line tool, such as java or javac . For the tools list, see the NonStop
Server for Java 6.0 Tools Reference .
classpath1:classpath2
Class paths to the .jar , .zip, or .class files. Each class path should end
with a filename or directory name depending on the particular setting.
For a .jar or .zip file that contains. class files, the class path ends with the
name of the .jar or .zip file.
For .class files in an unnamed package, the class path ends with the directory
name that contains the .class files.
For .class files in a named package, the class path ends with the directory
name that containsthe "root" package (the first package in the full package
name).
Multiple path entries are separated by colons.
The default class path is the current directory. Setting the CLASSPATH variable or using the
-classpath command line option overrides that default, so if you want to include the current
directory in the search path, you must include a dot (.) in the new settings.
38 Installation and Configuration