Environment Setup

Before you can use the API to build and execute models, it is important that you understand the environment in which you must compile and execute your code.

All the Java interfaces and utility classes necessary for programmatically creating and editing Isight applications are available in the SMAFIPsdk.jar file provided in your Isight installation. To compile the Java code that you write, you must have the Java Development Kit (JDK) installed.

JDK 7 is the supported version. This JDK can be downloaded from the Sun web site at http://java.sun.com/javase/downloads/index.jsp. JAVA JDKs are also available from other vendors.

Assuming that you have the JDK installed and it is on your system path, you can run the following command from a command prompt to compile your code:

>javac -classpath <Isight_install_directory>/<operating_system>/docs/java/SMAFIPsdk.jar MyApp.java

This command will be sufficient to compile your application code, but execution of your application requires that the classes and any other resource files for your application be provided in a jar (Java Archive) file and that the proper environment be established for your application to execute in. To create a jar file for your application, execute the following command:

> jar cf MyApp.jar *.class *.properties *.gif 

The process of establishing the proper environment for your application includes setting system environment variables, specifying the classpath to include your application jar file and jar files containing other required classes from the Isight installation, and providing the proper arguments. The Isight installation includes a fiperenv script for establishing the environment, and all applications must invoke this script before launching the main program for the application. In addition, the Isight installation provides a launch script to simplify the execution of your application. The scripts for the various applications in Isight (gateway, rtgateway, fipercmd, library, etc.) all make use of the fiperenv and launch scripts in the following way (shown for Windows .bat scripts here):

@echo off

setlocal
call "%~dp0%fiperenv.bat"

rem --- Set up and launch as command-line application
rem --- Add any needed Jar files to the following line
set LaunchClasspath=%FiperJars%;MyApp.jar
set LaunchPgm=<fully qualified path to your main class>
rem EXAMPLE: set LaunchPgm=com.engineous.system.cmdline.CmdClient

set LaunchArgs=%*
call "%~dp0%launch.bat"

The "%~dp0%" construction refers to the directory that contains the currently running batch file. This is a convenient way to make batch files independent of where they are installed. However, for this type of construction to work, your batch files must be in the same directory as fiperenv.bat.