NonStop Server for Java Programmer's Reference (NSJ 4.0+)

Documentation provided by Sun Microsystems
(http://java.sun.com/j2se/1.4.1/docs/tooldocs/solaris/classpath.html) describes the use of
CLASSPATH. When applying that documentation to the NonStop Server for Java 4, you should
follow the instructions given for sh and ksh instead of those for csh and tcsh. Instructions for
setenv and unsetenv do not apply to the NonStop Server for Java 4.
JREHOME
If you install the NonStop Server for Java 4 in a location other than the /usr/tandem/java
directory, and you plan to run the java executable or one of its tools directly out of the java/bin
directory, you must do the following:
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 4 at /h/myjava instead of
/usr/tandem, do the following to create and set the JREHOME variable:
export JREHOME=/h/myjava/java/jre
1.
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.
2.
Failure to specify the JREHOME variable may cause the Java VM to fail to start, prompting the
following Java error message:
Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)
Alternatively, the Java VM starts successfully but the jar files in the directory
/usr/tandem/java/jre/lib/ext are used instead of the files under the directory where
java is installed. This can produce unpredictable results.
Symbolic Link
The link /usr/tandem/java is created when NonStop Server for Java 4 is installed. It is a
symbolic link to the actual JDK directory, which has the form:
/usr/tandem/nssjava/jdk14x_v1y
where x refers to the version number of the Sun Microsystems update upon which NonStop Server
for Java 4 is based and y refers to the particular product version update (PVU) of NonStop Server for
Java 4. For example, for NonStop Server for Java 4, based on Java 2 Platform, Standard Edition,
SDK 1.4.1, the symbolic link is /usr/tandem/nssjava/jdk141_v10.
The /usr/tandem/java is a shorthand way to refer to the latest version of the JDK installed on
the system. When you unpax a NonStop Server for Java 4 pax file, the symbolic link is created or
reset to refer to the JDK directory that is being unpaxed, which means that the symbolic link refers to
the version of NonStop Server for Java 4 that was last installed. You are not required to use the
symbolic link. To make sure you are always using the 1.4.1 version of the JDK, even if a later version
has been installed, you can put /usr/tandem/nssjava/jdk141_v10/bin on your PATH.