Configuring Shells for StreamBase

To use and develop with StreamBase and Live Datamart (LDM) effectively, you must configure the shell environment for all users and any server processes that want to take advantage of StreamBase and LDM services.

Syntax shown on this page is for the Bash shell. Adjust these lines as required if you are using a different shell.

Shell Settings on Windows

StreamBase installations on Windows provide the StreamBase Command Prompt in the Windows Start menu. This opens a command prompt with its PATH and environment ready for use with StreamBase and Live Datamart tools. There is no need to manually configure the system or user environment in Windows.

If you prefer to use a UNIX-like environment on Windows such as Cygwin, use the Linux settings below as a guide for configuring your Bash setup files. Remember that absolute paths in Cygwin take the form /cygdrive/c/TIBCO... instead of C:\TIBCO.

Shell Settings for Linux

Modify the environment of all users who will use and develop with StreamBase by adding the following commands to their shell startup files. If you expect to install and run StreamBase Runtime nodes with a specific server-only username, be sure to modify the environment for that username as well.

Notice that the first command uses the back quote character ( ` ), not the single quote character:

eval `/opt/tibco/sb-cep/7.7/bin/sb-config --env`
export TIBCO_EP_HOME=$STREAMBASE_HOME

Make sure these commands are executed automatically for every shell window opened by adding commands like the following to shell startup files such as .bash_profile for each user:

if [ -x /opt/tibco/sb-cep/7.7/bin/sb-config ]; then
  eval `/opt/tibco/sb-cep/7.7/bin/sb-config --env`
  export TIBCO_EP_HOME=$STREAMBASE_HOME
else
  echo "No StreamBase installation detected."
fi

The sbconfig --env command sets an LD_LIBRARY_PATH variable for you, but that variable is no longer needed or used on recent Linux distributions. If that variable has no other use on your system by other products, you can remove that setting with a line like the following:

unset LD_LIBRARY_PATH

Remember that StreamBase supports only Oracle JDK 8. Linux distributions are usually configured to use the OpenJDK version of Java. On Linux, you can take advantage of the Oracle JDK bundled with StreamBase by adding lines like the following to your shell environment:

export JAVA_HOME=$STREAMBASE_HOME/jdk
export PATH=$JAVA_HOME/bin:$PATH

Place these lines after the export line in the startup script example above.

Shell Settings for macOS

Modify the environment of all users who will use and develop with StreamBase on this Mac by adding the following commands to shell startup files such as .bash_profile.

There is no default installation folder for StreamBase installations on macOS. If you use the .archive-bin installers, StreamBase installs by default in /opt/tibco, as on Linux. In this case, use the Linux settings above as a guide to shell configuration settings on macOS.

If you used the DMG installer, you can drag the StreamBase folder to any location on your Mac. The standard location for macOS programs is usually the system /Applications folder, but TIBCO recommends installing to ~/Applications, which is a folder also named Applications at the root of your home directory. The examples below presume you are using TIBCO's recommended installation path.

eval `~/Applications/TIBCO StreamBase 7.7.2/bin/sb-config --env`
export TIBCO_EP_HOME=$STREAMBASE_HOME

To make sure these commands are executed automatically for every Terminal window, add commands like the following to the shell initialization file for each user.

if [ -d ~/Applications/TIBCO\ StreamBase\ 7.7.2/bin ] ; then
  eval `~/Applications/TIBCO\ StreamBase\ 7.7.2/bin/sb-config --env`
  export TIBCO_EP_HOME=$STREAMBASE_HOME
else
  echo "No StreamBase installation detected."
fi

On macOS, if you have an Oracle JDK installed on your Mac (whose version is the same as the one installed with StreamBase or newer), you can use these lines to configure command-line Java:

export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
export PATH=$JAVA_HOME/bin:$PATH

If you do not have a separate Oracle JDK installed, you can take advantage of the JDK bundled with StreamBase with lines like the following:

export JAVA_HOME=$STREAMBASE_HOME/jdk
export PATH=$JAVA_HOME/bin:$PATH

In addition to the usual macOS ways to open a Terminal, StreamBase Studio provides a shortcut. Select the top level of an EventFlow or LiveView project folder in Studio's Project Explorer, right-click, and select Open StreamBase Command Terminal Here from the context menu. This opens a Terminal whose current directory is the selected project's directory in the Studio workspace.

Suggested Alternative for macOS

You might find it helpful to create a symbolic link in your ~/Applications folder to avoid issues with the spaces in the StreamBase folder name. For example:

cd ~/Applications
ln -s TIBCO\ StreamBase\ 7.7.2 streambase

With this symlink in place, you can use the following script in your shell initialization files instead of the one above:

if [ -d ~/Applications/streambase/bin ] ; then
    eval `~/Applications/streambase/bin/sb-config --env`
    export TIBCO_EP_HOME=$STREAMBASE_HOME
else
    echo "No StreamBase environment detected."
fi

This method has the advantage of not requiring changes to your shell startup files when you install new major and minor releases of StreamBase. You only have to change where the symbolic link points.

Shell Setting Reference

The shell environment on macOS and Linux requires the environment variable settings shown in this section. TIBCO recommends configuring your shell environment by using the sb-config --env command, as described in the Linux and macOS sections above.

The first set of variables are set by the sb-config --env command:

STREAMBASE_HOME environment variable

Set this to the full, absolute path to the root of the StreamBase installation directory, such as:

/opt/tibco/sb-cep/7.7
/Users/sbuser/Applications/TIBCO StreamBase 7.7.2
/Applications/TIBCO StreamBase 7.7.2
C:/TIBCO/sb-cep/7.7
Add two StreamBase folders to the PATH

Both of the following folders must by on the shell's PATH in order to run StreamBase command-line utilities and the epadmin management and deployment tool:

$STREAMBASE_HOME/bin
SSTREAMBASE_HOME/distrib/tibco/bin
Add StreamBase man pages to the MANPATH

Add the folder containing man pages for StreamBase command-line utilities to the MANPATH:

$STREAMBASE_HOME/man
LD_LIBRARY_PATH environment variable

This variable is still set by sbconfig --env, but is no longer needed or used on recent Linux distributions. You can unset this variable.

The following settings must be made manually:

TIBCO_EP_HOME environment variable

Set this to the same full path as STREAMBASE_HOME. This variable is used in, and is automatically set by, StreamBase Studio, which does not take it from the operating system environment. This variable is not required for using the epadmin command-line deployment tool, but the variable is set into some pom.xml files by Studio. Therefore, this variable is needed in case you use command-line mvn on Studio projects, and is also presumed as a shortcut in some samples.

JAVA_HOME

The epadmin command requires a valid JAVA_HOME to be set and its bin directory added to the PATH. StreamBase Studio requires and includes an Oracle JDK 8 release. The epadmin command requires at least a JRE 8. In either case, if you are using an installed JDK or JRE, its version must be the same as or newer than the one installed with StreamBase.

To take advantage of the JDK 8 bundled with StreamBase, use lines like the following:

export JAVA_HOME=$STREAMBASE_HOME/jdk
export PATH=$JAVA_HOME/bin:$PATH

Additional Shell Settings for Client Development

To develop client programs that will access StreamBase servers or Live Datamart servers, you may need to specify additional environment settings. Use sb-config command options such as sb-config --cxx or sb-config --classpath to configure your development environment. See the sb-config reference page for details.