NonStop Server for Java 6.0 Programmer's Reference

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
environment variable so that the Java runtime can find the class named Cool.class, you would
use the following command to set and export the CLASSPATH environment variable and then run
Java.
To run that application, you could use the following commands:
$ export CLASSPATH=/java/MyClasses
$ java utility.myapp.Cool
For further information about setting class path, see the documentation provided by Sun Microsystems
(http://docs.oracle.com/javase/6/docs/technotes/tools/index.html). Note that when applying
that documentation to the NonStop Server for Java 6.0, you must follow the instructions given for
sh and ksh instead of those for csh and tcsh. Instructions for the setenv and unsetenv
commands do not apply to the NonStop Server for Java 6.0.
JREHOME
The JREHOME shell variable is used by the Java runtime to determine where the core Java classes
are located. If you install NonStop Server for Java 6.0 in the standard location, you do not need
to set up the JREHOME shell variable because it has the default value of /usr/tandem/java/jre.
NOTE: If you are using NonStop Server for Java 6.0 version T2766H60^ABP or later, you need
not set the JREHOME variable because the Java classes will be located based on the location of
the Java executableof a given JDK installation.
If you install the NonStop Server for Java 6.0 in a location other than the /usr/tandem/java
directory, you must do the following:
1. Create a shell variable called JREHOME and set it to the location of the jre directory. For
example, if you installed the NonStop Server for Java 6.0 at /h/myjava instead of
/usr/tandem, do the following to create and set the JREHOME variable:
$ export JREHOME=/h/myjava/java/jre
2. You must create the JREHOME shell variable in each shell in which you plan to run java or
one of its tools. For this reason, it is a good idea to put a creation mechanism in the .profile
file in your home directory that is executed each time you log on to an OSS shell. See the
Open System Services User's Guide for information on how to set the path in your startup file.
Failure to specify the JREHOME variable may cause the JVM to fail to start, prompting the following
Java error message:
Can't find class java.lang.NoClassDefFoundError. (Wrong classpath?)
Alternatively, the JVM starts successfully but the jar files in the directory /usr/tandem/java/jre
are used instead of the files under the directory where NonStop Server for Java 6.0 is installed.
This can produce unpredictable results.
Configuration Requirements 39