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. Browse to the <RemoteEngineInstallationDirectory>/etc directory.
  3. Depending on the type of the artifacts you need to run with a specific Java version, do the following:
    • For Jobs, add the path to your Java instance to be used to your PATH environment variable. Then open a command-line terminal and execute the java -version command. You should see the version of the Java instance printed.

      Any Java process starts with this instance defined in the PATH.

    • For Microservices, in the <RemoteEngineInstallationDirectory>/etc/org.talend.ipaas.rt.dsrunner.cfg, add the path to the Java executable file. For example,
      ms.custom.jre.path=C\:/Java/jdk/bin

      Make this modification before deploying your Microservices to ensure that these changes are correctly taken into account.

    For both artifact types, use backslashes to escape characters specific to a Windows path, such as colons, whitespace, and directory separators, while keeping in mind that directory separators are also backslashes on Windows. For example:
    c:\\Program\ Files\\Java\\jdk11.0.18_10\\bin\\java.exe
  4. 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!