Running the Application

You will now configure and run the example application. This includes defining VM arguments, setting the classpath, and extending some environment variables.

  1. From the Eclipse editor, select Run -> Run Configurations.

    The Run Configurations dialog box appears.

  2. Right-click Java Application, and select New.

  3. In the Name text box, enter the name of your project.

  4. On the Main tab, do the following:

    1. In the Project text box, enter the name of the project.
    2. In the Main class text box, enter the fully qualified name of the main class of the application.

  5. Click the Arguments tab, and do the following:

    1. In the VM arguments area, enter the following:

      -Xms32M

      -Xmx500M

      -Dfiper.system.esihome="<Isight_install_directory>

      -Dfiper.system.temp="C:/temp/fiper"

      -Dfiper.system.templib= "C:/temp/fiper/libtemp0"

      -Djava.library.path="C:/temp/fiper/templib;

      <Isight_install_directory>/<operating_system>/code/bin;

      C:/WINDOWS/SYSTEM;C:/WINDOWS/SYSTEM32"

    2. In the Working directory area, select Other and enter the following in the text box:

      <Isight_install_directory>/<operating_system>/examples/development/applications

      This working directory is specific to this example application. You should choose a more appropriate one when setting up your own application.

  6. Click the Classpath tab, and do the following:

    1. Select User Entries, and click Add External JARs.

      The Jar Selection dialog box appears.

    2. Select the <Isight_install_directory>/<operating_system>/docs/java/SMAFIPcommon.jar file, and click Open.
    3. Repeat steps a and b for the following files:

      • <Isight_install_directory>/<operating_system>/docs/java/SMAFIPsystemsdk.jar
      • <Isight_install_directory>/<operating_system>/docs/java/SMAFIPutiljni.jar
      • <Isight_install_directory>/<operating_system>/docs/java/SMAFIPlibrary.jar
      • All of the JAR files in the following directory:

        <Isight_install_directory>/<operating_system>/docs/javacommon/

      These are the only files needed to run the example application. It is recommended that you include all the JAR files in the <Isight_install_directory>/<operating_system>/docs/java directory when running your own application.

  7. Click the Environment tab, and do the following:

    1. Click New.

      The New Environment Variable dialog box appears.

    2. In the Name text box, enter PATH as the name.
    3. In the Value text box, enter the following:

      C:/temp/fiper/templib;
      <Isight_install_directory>/<operating_system>docs/java;
      <Isight_install_directory>/<operating_system>/code/bin;
      <Isight_install_directory>/<operating_system>/examples/models/simcodes/bin/<operating_system>;
      ${env_var:PATH}
      

    4. Click OK to return to the Environment tab.
    5. Select Append environment to native environment.

  8. Click Run.

    The example application executes to completion without error, and the opt-template.zmf file is created in the working directory. You can now easily make changes to the example code, save the file, and run the application again by selecting Run -> Run from the Eclipse editor.