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

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:
$java HelloWorld
b.
Note that you should not type java HelloWorld.class. All Java classes have the
.class extension. Typing .class at the end causes an error message.
Your Java application displays the message, "Hello World!".
Specifying the CPU and Process
Name with Which an Application
Runs
You can specify which CPU an application process runs in and its process name by using
options of the run utility. The run utility starts OSS programs with specific attributes.
The format of the command to specify the CPU where a Java application is to run is:
run -cpu=cpu_number java class_name
For example, the command to run Java in CPU 3 is:
$run -cpu=3 java HelloWorld
The format of the command to give a java process a process name is:
run -name=/G/process_name java class_name
For example, the command to give Java the process name $APPJ is:
$run -name=/G/appj java HelloWorld
where the /G directory identifies the Guardian fileset. For information about the
/G directory, see the Open System Services User's Guide.
The following example combines more than one run option in a single command:
$run -name=/G/japp -cpu=3 java HelloWorld