Installing a JDK

JDK Requirements

StreamBase Studio and the Streaming Runtime require an installation of JDK 17 in order to compile and run StreamBase and LiveView fragments and applications from within StreamBase Studio. A JRE is not sufficient to run StreamBase and LiveView applications; you must have a JDK.

On all supported operating systems, the StreamBase installation kit provides the runtime components of Eclipse Temurin™ 17.0.8 (formerly known as AdoptOpenJDK) listed in Supported Configurations. This bundled JDK is placed in the jdk subdirectory of the Streaming installation directory. When looking for installed JDKs, Studio only searches for a JDK 17 at the same or higher release level as the one bundled with Streaming.

JDK 17 (from version 17.0.8 onwards) is the only Java release compatible with Streaming.

On Windows, by default, the StreamBase Command Prompt looks in standard installation locations for an Eclipse Temurin installation, and uses the latest version detected. That is, by default, the sb-config --java-home command used by the StreamBase Command Prompt does not rely on the JAVA_HOME environment variable, and ignores it if set. The JDK bundled with Streaming is used only if no appropriate JDK 17 is detected.

For macOS and Linux, it is the best practice to use sb-config --java-home in your shell startup scripts, as described below in Using the Streaming-Determined JDK and in StreamBase-Configured Shells.

Starting with Streaming 10.3.0, StreamBase command-line tools such as epadmin and sbc do not use Java and do not require Java to be in the system PATH. (The jsbc and jsbadmin commands, however, do use Java.)

The bundled maven command, mvn, does require Java. It uses the java command that the StreamBase Command Prompt or StreamBase-configured shell places first in the PATH. (Maven might also use a different Java version if so configured in POM files.)

Streaming is not supported with gcj or icedtea. However, StreamBase and LiveView fragments configured to run in Docker containers use Eclipse Temurin 17.0.8 inside the container.

Installing a System JDK

Installing a system-level JDK has the advantages of being maintainable independently of Streaming.

Download and install a recent JDK from Adoptium. Select a JDK 17 release, and not just a JRE. The recommended version is a JDK from the same release as the JDK bundled with Streaming, or newer. Studio rejects JDK releases earlier than the supported version, falling back to the bundled version if detected.

On all the platforms, make sure that the installer configures your command shell environment to add $JAVA_HOME/bin (or %JAVA_HOME%\bin) to your system PATH. If your JDK installer does not make this change, configure it manually in the system environment for Windows, or in the shell login scripts for users on macOS and Linux.

Note

Newer Java installers no longer set the JAVA_HOME environment by default. If your shell environment has a legacy setting for JAVA_HOME, make sure it points to the newly installed JDK.

On Windows, download and install the 64-bit JDK option, because Streaming is supported only on 64-bit editions of Windows.

On macOS, install a JDK from Adoptium.

On RedHat Linux, AlmaLinux, and Amazon Linux, the base installation might have installed a recent OpenJDK release.

Using the Streaming-Determined JDK

On Windows platforms, the StreamBase Command Prompt looks in standard locations for an Eclipse Temurin installation. If found, the Command Prompt adds its bin directory to the PATH. If not found, the JDK bundled with Streaming is added to the PATH.

On macOS and Linux, you can emulate the Windows behavior by placing commands in your shell startup script like these examples:

  • Set JAVA_HOME to the output of sb-config --java-home.

  • Then add $JAVA_HOME/bin to the PATH.

Changing Default Behavior

You can change the default behavior described above by means of the STREAMBASE_USE_INTERNAL_JDK environment variable, which can be set to one of three values:

  • fallback — If set to fallback, or not set, this configures Studio to try to locate a system-installed JDK, and to use the Streaming bundled JDK only if an acceptable system JDK is not found.

  • true — Always use the JDK bundled with Streaming. This was the default value of STREAMBASE_USE_INTERNAL_JDK before release 10.4.0.

  • false — Use the JDK specified in the JAVA_HOME environment variable, if set. JAVA_HOME must be set to the full, absolute path to the top-level directory containing your JDK.

    If set to false, but no JAVA_HOME is defined, Streaming searches the system PATH for a JDK. If not found, Streaming looks in standard installation locations for a JDK. If still not found, Studio does not start.

Troubleshooting JDK Selection

To help determine which JDK StreamBase Studio uses, you can temporarily start Studio from a StreamBase Command Prompt on Windows, or from a StreamBase-configured shell prompt on macOS, with commands like the following.

On macOS, run:

STREAMBASE_JAVA_LAUNCHER_VERBOSE=1 sbstudio &

On Windows, the sbstudio command suppresses stderr output by default, so we use jsbc instead. Both jsbc and sbstudio commands use the same method to determine the Java command to use.

set STREAMBASE_JAVA_LAUNCHER_VERBOSE=1
jsbc