Running the Java API Examples

Pre-requisites: Before running the Java examples, ensure that your environment variables have been set up for running ActiveSpaces.

Examples.jar or ASPaint.jar must be appended to your CLASSPATH depending upon which example you are running.

Procedure

  1. Set your CLASSPATH variable as follows, on a Microsoft Windows platform.

    <TIBCO_HOME>\as\<version>\examples\java\Examples.jar;

    <TIBCO_HOME>\as\<version>\examples\java\ASPaint.jar

  2. If any additional jar files need to be appended to your CLASSPATH for running an example, the section on that example will have the additional information.
  3. After your CLASSPATH is set appropriately, you can invoke all of the Java examples by using the following basic command:
    java example_name command_line_arguments

    For example, to run ASOperations with the default settings, enter:

    java ASOperations

    See Command Line Arguments for information on the command line arguments that you can use when invoking the examples.

  4. Alternatively, in Java, you can launch the example programs using the java command with the classpath (-cp) parameter.
    java -cp Examples.jar class_name command_line_arguments

    where class_name is the name of the example class. For example:

    java -cp Examples.jar ASChat
  5. ASOperations is the default class for the jar file and can be launched directly using
    java -jar Examples.jar