NonStop Server for Java 6.0 Programmer's Reference

class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
d. Alternatively, at the OSS prompt, use the cat command to create the HelloWorld.java
file and type the contents of the HelloWorld program listed previously.
$cat> HelloWorld.java
type-contents-of-the-file
(Ctrl+y)
2. Set the JREHOME Shell Variable.
If you know that the NonStop Server for Java 6.0 product is installed on your system in the
standard location, you can omit this step. The standard location for the NonStop Server for
Java 6.0 installation is:
/usr/tandem/
If you do not know where the NonStop Server for Java 6.0 product is installed, ask your system
administrator.
The JREHOME shell variable must point to the jre directory of your installation of the NonStop
Server for Java 6.0 product.
The default value for JREHOME is:
/usr/tandem/java/jre
If the NonStop Server for Java 6.0 is installed in a different location, for example /test_dir,
type the following command at the OSS prompt set the JREHOME shell variable:
$export JREHOME=/test_dir/java/jre
3. Set the PATH Environment Variable.
Add the directory where the NonStop Server for Java 6.0 executable file is installed to your
PATH environment variable.
For the standard installation, type the following command at the OSS prompt:
$export PATH=/usr/tandem/java/bin:$PATH
If the NonStop Server for Java 6.0 is installed in a nonstandard location, /test_dir, type:
$export PATH=/test_dir/java/bin:$PATH
4. Check Your Path Settings.
Optionally, you can check whether your path is set correctly by using the whence command.
Type:
$whence -v java
This command should display the fully qualified name of the java executable found in your
path. If no Java executable is found, the command displays the message, "java not found".
5. Compile the Java Source Code by Using the javac Tool.
a. Ensure you have performed step 3 so that javac is in your current path.
b. At the OSS prompt, change the directory (cd command) to where your Java source file
is stored.
Tutorial: Running a Simple Program, HelloWorld 33