Run examples in the documentation easily


You want to run the examples included in this documentation file easily.


The SDK includes a compiled jar that includes all the code included in this documentation.

The path to the jar is: [PathToSTKScalabilityApiJavaFolder]\Documentation\stkscalabilitysdk-examples-1.4.0.jar

To run one of the examples, first select an example to run. For instance, let's pick the example code from Optimize task setup time with task environment.

Take note that the class name is stkscalabilitysdk.howto.TaskEnvironmentExample.

Copy agi.parallel.client-1.4.0.jar to the Documentation directory.

Finally, run a Java command that includes both the Client and SDK Examples jars in the classpath and uses the name of the example as the main class.

java -cp "agi.parallel.client-1.4.0.jar;stkscalabilitysdk-examples-1.4.0.jar" stkscalabilitysdk.howto.TaskEnvironmentExample
Example output from running examples

The code for all the examples in this documentation is included and compiled so that it is easier to test and experiment without having to write too much code. All the examples in the documentation have a main entry point and will usually write something to standard output. In addition to the complete example applications in the SDK, the documentation examples are a good resource for the API for Java. As you go through the examples in the How To sections, make sure you run each example so that you can better understand what the API can do.

An important thing to note is that all the examples hard-code "localhost" as the address of the cluster job scheduler. You will have to ensure that the Coordinator is running locally on your submitter machine.

See Also

STK Scalability 1.4 API for Java