NonStop Server for Java 6.0 Programmer's Reference
Verifying the Java Installation
Ask your system administrator where the NonStop Server for Java Server 6.0 software is installed.
Knowing that, you can verify the installation and verify your environment. This example assumes
that NonStop Server for Java 6.0 is installed in a nonstandard location—the /home/lee/jdk60
directory:
NOTE: If your NonStop Server for Java 6.0 software is installed in the standard location
(/usr/tandem), or if you are using NonStop Server for Java 6.0 version T2766H60^ABP or
later, skip Step 4 and Step 5 and specify the location values accordingly.
For more information about the operating system requirements, see the T2766H60^ABP softdoc
or the Readme.txt file packaged with the NonStop Server for Java 6.1 software distribution CD.
1. Set the PATH environment variable by using the following command at the OSS prompt:
$export PATH=/home/lee/jdk60/java/bin:$PATH
2. Confirm that the path is set correctly by typing the whence command:
$whence java
/home/lee/jdk60/java/bin/java
3. Determine the version of the Java virtual machine (JVM) by typing the vproc command, which
displays the product versions of the java binary file and any products bound into the java
binary. For the version of the NonStop Server for Java 6.0 installation, look for the product
number T2766 following a line that begins Version Procedure: The displayed version
identifier changes with every update of NonStop Server for Java 6.0.
The version identifier has the following form:
T2766Hnn
A vproc example is:
Version procedure: T2766H60_30Jan2009_jdk60...
4. To set the JREHOME shell variable, type the following command at the OSS prompt:
$export JREHOME=/home/lee/jdk60/java/jre
5. To confirm that your JREHOME shell variable is set correctly, type the following echo command
at the OSS prompt:
$echo $JREHOME
/home/lee/jdk60/java/jre
Tutorial: Running a Simple Program, HelloWorld
After the NonStop Server for Java 6.0 is installed, follow these steps to create and run the
HelloWorld program.
The default OSS prompt is the dollar sign ($). The commands show the prompt, so do not type it.
In text showing computer input and output, the input you type is shown in bold.
1. Create a java Source File.
Perform either steps a, b, and c or step d only.
a. Using your favorite editor, create a file that contains the following source code.
b. Name the file HelloWorld.java.
c. Place the file in the OSS file space by using FTP.
/**
* The HelloWorld application implements a java class that
* displays "Hello World!" to the standard output.
*/
32 Getting Started










