Deploying an STK Engine Application

Perform the following to deploy an STK Engine application:

  1. License your application.
  2. Package the STK Engine files with your application.
  3. Set up the runtime environment.

Note: You can include the AGI License Server when deploying an STK Engine application.

The following procedures create an end-user install by:

  1. Adding deployment licensing support to your application.
  2. Starting with the AGI STK Engine packages, and removing the unneeded files.
  3. Setting up the runtime environment.

Licensing your Application

Deployment licenses use the concept of a vendor identifier to identify your organization and restrict the license to your deployed application.

  1. Add the following code to your STK Engine application after initializing the STK Java API but before creating or using any STK Engine controls:
  2. this.m_AgSTKXApplicationClass = new AgSTKXApplicationClass();
    this.m_AgSTKXApplicationClass.setVendorID("<vendor id>");
  3. Run the aglmhostid application on the machine where you intend to deploy your STK Engine application to acquire the host ID for that machine. The aglmhostid application can be found in the <install dir>/bin directory.
  4. <install dir>/bin/aglmhostid
  5. Submit both the vendor ID that you added to your code and the host ID from step 2 to AGI (see Licensing an STK Engine Application). AGI will generate the license file.
  6. The end user should place the license file in the same directory as the binary executables being deployed or in the bin/LicenseData/ directory. (To use the LicenseData directory for storing license files, you must first create it.)

Files to Package with your Application

The STK Engine on Linux packages support side by side and isolated installation. The files can be directly included into your application directory layout. You can either re-use the original archive files, or modify them to remove the datasets that are not required for the specific functionality exercised by your application.

The original archive files provided are:

File Description


The STK 64-bit shared libraries.


The STK 32-bit shared libraries.


The core STK data.


The optional STK data for interplanetary support.


The STK Java API jar files (including Javadoc).


The STK Java API code samples (Contains all the STK Java API examples, including the examples for STK Desktop/Windows development. The examples applicable to STK Engine on Linux are under CodeSamples/CustomApplications/Java).


The documentation.

The binaries (stk_binaries_v11.2.0_x86.tgz if you are deploying a 32-bit application or stk_binaries_v11.2.0_x64.tgz if you are deploying a 64-bit application) and jar files (stk_jars_v11.2.0.tgz) are required to deploy a Java engine application. In the jar archive (stk_jars_v11.2.0.tgz), you can eliminate the Javadoc and any jar file(s) that you do not use in your application.

The core data package (stk_data_v11.2.0.tgz) is usually required. You might be able to eliminate some of the content (for instance Data/ExampleScenarios) if you are not directly using it in your application. The planetary data package is only required if your application requires the additional interplanetary central bodies.

The code samples and documentation are not needed for a deployment (they are resources for development) and can generally be left out.

Runtime Setup

Once you have packaged the required files with your application, the same three environment variables described in Setting Up the Environment need to be configured. These environment variables can be set in a script (for instance in the script where you configure your classpath), or they can also be set programmatically in your application before initializing the STK Java API. The three environment variables required are described below.

The path to the bin directory needs to be added to your LD_LIBRARY_PATH environment variable:

export LD_LIBRARY_PATH=<install dir>/bin;$LD_LIBRARY_PATH

The next two environment variables need to be set up to indicate where STK Engine reads its data from and where it stores the user specific configuration:

export STK_INSTALL_DIR=<install dir>

export STK_CONFIG_DIR=<location for user specific configuration data>

The directory pointed to by the $STK_CONFIG_DIR environment variable will be initialized automatically with the default settings the first time your deployed application runs. If the default settings are not appropriate, you can use the stkxnewuser helper application as part of your installation scripts to customize those settings. See New User Install, Online Data & Proxy for more details.

STK Engine for UNIX 11.2