Skip to main content Skip to complementary content

Setting up compatible Java versions to run Jobs or Microservices

Configure your Remote Engine to execute Jobs or Microservices using the appropriate Java version based on those artifacts' Java compatibility levels.

By default, a Remote Engine uses the Java version of its environment to execute Jobs or Microservices. With Remote Engine v2.13 and onwards, Java 17 is mandatory for engine startup.

However, two approaches are available to configure different Java versions to run Jobs or Microservices:

Adaptive mode: Configuring Remote Engine to dynamically select Java version

In this mode, Remote Engine automatically selects the appropriate Java instance based on the Java compatibility level of artifact to be executed (Jobs or Microservices).

This dynamic Java version (adaptive) mode helps you execute artifacts from different Studio versions without rebuilding.

Information noteTip: The artifact's Java compatibility level is set in Talend Studio.

Procedure

  1. Stop the engine.
  2. In the <RE_installation>/etc/system.properties file, set the org.talend.execution.JAVA_*_PATH properties with the paths to your Java installations.
    #
    # artifact dynamic Java version configuration
    # (to select Java version for artifact execution
    # based on the artifact Java compliance level)
    # java path must point to Java bin directory, e.g.
    # /usr/lib/jvm/java-17-openjdk-amd64/bin
    # C:\\Program Files\\Java\\bin
    #
    org.talend.execution.JAVA_8_PATH=/path/to/java8/bin
    org.talend.execution.JAVA_11_PATH=/path/to/java11/bin
    org.talend.execution.JAVA_17_PATH=/path/to/java17/bin
    Remote Engine selects the Java version as follows:
    • Analyzes the artifact's Java level as the candidate version.
    • If the candidate is configured with org.talend.execution.JAVA_*_PATH, uses that Java instance.
    • If not configured, selects the next higher configured Java version.

      For example, if an artifact uses Java 8 but Java 8 is not configured while Java 11 is, Remote Engine selects Java 11.

    • If org.talend.execution.JAVA_17_PATH is unset while it is needed by the artifact, the Java instance for engine startup is used. As mentioned earlier, for Remote Engine v2.13 and onwards, Java 17 is the default version for engine startup.
    Information noteTip: When installing Remote Engine v2.13.9 or later using the installer, the adaptive mode is automatically activated. The installer sets org.talend.execution.JAVA_17_PATH with the Java instance for engine startup. During installation, you can additionally configure the installer to set org.talend.execution.JAVA_8_PATH or org.talend.execution.JAVA_11_PATH. For more details, see Installing Remote Engine automatically.
  3. Restart the engine.

Specifying a Java version to run Jobs or Microservices

Configure your Remote Engine to run Jobs or Microservices using a specific Java version. If you have activated the adaptive mode explained above, ignore this section.

This section provides an alternative to the adaptive mode if the latter is not available to your engine version. It allows you to run the artifacts designed with Java versions older than Java 17.

When developing new Jobs or Microservices, consider building them with the add-opens option to ensure compatibility with Java 17. This option opens the necessary packages for Java 17 compatibility, making your Jobs or Microservices directly runnable on the newer Remote Engine version, without having to go through the procedure explained in this section for defining a specific Java version. For further information about how to use this add-opens option and its limitation, see Setting up Java in Talend Studio.

Procedure

  1. Stop the engine.
  2. Depending on whether the engine has been installed as a Linux system service, do the following:
    • If the engine was not installed as a Linux system service:
      1. Browse to the <RemoteEngineInstallationDirectory>/bin/setenv file.
      2. Add the following line: export PATH="<path-to-jvm-bin-directory>:${PATH}"

        This path-to-jvm-bin-directory is the path to the bin folder of the JVM instance you need to use to run Jobs or Microservices. This line adds this path to the PATH environment variable.

    • If the engine was installed as a Linux system service:
      1. Browse to the <RemoteEngineInstallationDirectory>/etc/talend-remote-engine-wrapper.conf file.
      2. Add the following line to the Wrapper Properties section or change the path if this line exists already:
        set.PATH=<desired-java-home-path>:%PATH_WITH_JAVA%
        This desired-java-home-path is the path to the bin folder of the Java instance to be used. This path must be added right after set.PATH=. Keep %PATH_WITH_JAVA% as is.
  3. Restart the engine.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!