NonStop Server for Java 4.2 Programmer's Reference
option when calling an SDK 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
sdkTool -classpath classpath1:classpath2...
-or-
export CLASSPATH=classpath1:classpath2...
sdkTool
A command-line tool, such as java or javac. For the tools list, see the NonStop
Server for Java 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 contains the "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.
Class path entries that are neither directories nor archives (.zip or .jar files) are ignored.
Example: Setting Class Path in a java Command
Suppose you want the Java runtime to find a class named Cool.class in the package
utility.myapp. If the path to that directory is: /java/MyClasses/utility/myapp, you
would set the class path so that it contains /java/MyClasses.
To run that application, you could use the following java command:
$java -classpath /java/MyClasses utility.myapp.Cool
Example: Setting the CLASSPATH Environment Variable
Using the same situation as in the preceding example, except that you want to set the CLASSPATH