NonStop Server for Java (NSJ) Programmer's Guide (NSJ 2.1+)

JREHOME
If you install Nonstop Java in a location other than the /usr/tandem directory, and you plan to run
the java executable or one of its tools directly out of the
java/bin/oss/bin/posix_threads directory instead of through the shell wrappers in
java/bin, 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 NonStop Java 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 JVM to fail to start, prompting the
following Java error message:
Can't find class java.lang.NoClassDefFoundError. (Wrong class path?)
Alternatively, the JVM 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 Java is installed. It is a symbolic link to
the actual JDK directory (such as /usr/tandem/nssjava/jdk122_v21), and is a shorthand
way to refer to the latest version of the JDK installed on the system. When you unpax a NonStop Java
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 Java that was last installed. You
are not required to use the symbolic link. To make sure you are always using the 1.2.2 version of the
JDK, even if a later version has been installed, you can put
/usr/tandem/nssjava/jdk122_v21/bin on your PATH. You can also reset the symbolic
link yourself by using the ln command with the -s option. For example, if you install an IPM based
on version 1.6 of the JDK, but still want version 1.2.2 to be the one referred to by
/usr/tandem/java, you can merely reset the symbolic link instead of unpaxing version 1.2.2
again:
ln -s /usr/tandem/nssjava/jdk122_v21 /usr/tandem/java
The symbolic link is always put in the directory where NonStop Java is installed, so if you use the -s
option to specify an alternative installation directory during the unpaxing step, the symbolic link is
install_dir/java instead of /usr/tandem/java. For example, if
nssjava/jdk122_v21 is installed in /h/myjava, the symbolic link is /h/myjava/java. I t
is symbolically linked to /h/myjava/nssjava/jdk122_v21.