NonStop Server for Java 4.2 Programmer's Reference
3. Set the PATH Environment Variable.
Add the directory where the NonStop Server for Java 4 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 4 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.
Ensure you have performed step 3 so that javac is in your current path.a.
At the OSS prompt, change the directory (cd command) to where your Java source file is stored.b.
Compile the Java source code by using the Java compiler, javac, which is part of the installed
NonStop Server for Java 4 product. Type the following command at the OSS prompt:
$javac HelloWorld.java
If compilation is successful, the compiler produces a Java class file called HelloWorld.class.
Once you have the class file, your program is ready to run.
c.
Check to see that the HelloWorld.class file has been created by typing:
$ls -l HelloWorld.class
If the file is not present or if you received an error message, check for typographical errors in your
source code. Fix them, and perform sub-steps c and d again until you have a class file.
d.
6. Run the Program by Using the java Tool.
At the OSS prompt, ensure that the position is in the directory where your HelloWorld.class
file is stored. For information about changing position, see step 5b.
a.
To run the HelloWorld program (also called an application), type the following command at the
OSS prompt:
b.