Setting up environment variables for a Java Application to use TIBCO Enterprise Runtime for R

For a Java application to use the embedded TIBCO Enterprise Runtime for R engine, you must prepare the environment.

Procedure

  1. Set the JAVA_HOME environment variable to the base of the Java installation.
    This step is necessary because the embedded TIBCO Enterprise Runtime for R engine automatically loads the terrJava package, which requires this environment variable.
  2. Set the TERR_HOME environment variable to the base of the TIBCO Enterprise Runtime for R installation (that is, the directory containing subdirectories bin, library, and so on).
  3. Set the Java classpath to include the file TERR_HOME/library/java/terrJava.jar, which contains the Java code for starting and controlling an embedded TIBCO Enterprise Runtime for R engine.
    The Java classpath can be set by setting the CLASSPATH environment variable, or giving the - classpath argument when starting Java.
  4. Set the appropriate environment variable so Java can access the TIBCO Enterprise Runtime for R engine libraries.
    • On Windows, you must add TERR_HOME/bin/x64 (if you are using 64-bit TIBCO Enterprise Runtime for R and Java) or TERR_HOME/bin/i386 (if you are using 32-bit TIBCO Enterprise Runtime for R and Java) to the PATH environment variable.
    • On Linux, you should add TERR_HOME/lib/x86_64-unknown-linux/ to the LD_LIBRARY_PATH environment variable.

What to do next

To test that these environment files are set correctly, the class com.tibco.terr.TerrJava (in terrJava.jar) contains a main method that implements a simple TIBCO Enterprise Runtime for R console. See Example for setting Windows environment variables or Example for setting Linux environment variables.