Skip to main content Skip to complementary content

Setting up compatible Java versions for Talend JobServer to run Jobs

Configure your JobServer to execute Jobs using the appropriate Java version based on those Jobs' Java compatibility levels.

By default, a Talend JobServer uses the Java version of its environment to execute Jobs. Therefore, if you skip this section, Talend JobServer defaults to Java 17.

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

Adaptive mode: Configuring Talend JobServer to dynamically select Java version

In this mode, Talend JobServer automatically selects the appropriate Java instance based on the Java compatibility level of the Job to be executed.

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

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

Procedure

  1. Stop the Talend JobServer. For a graceful shutdown, see Shutting down Talend JobServer gracefully.
  2. Go to the directory where Talend JobServer is installed, and open the start_rs.bat file to edit it.
  3. Add the Java system properties to the MY_JVM_ARGS line. These properties provide the paths to your Java installations.
    set MY_JVM_ARGS="-Dcom.sun.management.jmxremote -Dorg.talend.execution.JAVA_8_PATH=\path\to\java8\bin -Dorg.talend.execution.JAVA_11_PATH=\path\to\java11\bin -Dorg.talend.execution.JAVA_17_PATH=\path\to\java17\bin"                  
    Talend JobServer selects the Java version as follows:
    • Analyzes the Job'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 a Job uses Java 8 but Java 8 is not configured while Java 11 is, Talend JobServer selects Java 11.

    • If org.talend.execution.JAVA_17_PATH is unset while it is needed by the Job, the Java instance for server startup is used.
  4. Restart the JobServer.

Typical use cases for the adaptive mode

  • Jobs built to run on Java 8:

    These Jobs are compiled with the Java 8 compliance level and does not include --add-opens (the Enable Java 17 compatibility checkbox is not selected). They are generally compatible with Java 11. Setting both Java 8 and 11 or setting Java 11 alone in adaptive mode ensures they run correctly.

    Information noteTip: Java 8 does not support --add-opens.
  • Standard (data integration) Jobs built to run on Java 11:

    These Jobs are compiled with the Java 8 compliance level and include --add-opens where needed (the Enable Java 17 compatibility checkbox is selected).

    They are generally compatible with Java 11. Running them on Java 17 are possible but can be error-prone, as --add-opens may lack necessary modules for Java 17 to correctly work.

    Setting Java 11 in adaptive mode allows it to handle these Jobs.

  • Jobs built to run on Java 17:

    These Jobs are compiled with the Java 17 compliance level. They run on the Java 17 instance set in adaptive mode or, if unset, on the server’s default Java instance.

What to do next

If you need to install Talend JobServer as a service, refer to this step to set up compatible Java version to run Jobs.

Configuring the JVM for your Talend JobServer

Talend JobServer allows you to choose another JVM than the one used by default to run your Jobs. If you have activated the adaptive mode explained above, ignore this section.

About this task

For example, you can configure Talend JobServer to start with Java 17 and execute Jobs with Java 11.

To achieve the same results with Talend JobServer installed as a service, see Installing Talend JobServer as a service on Windows.

Procedure

  1. If not done yet, add the path to your Java 11 instance to your PATH environment variable.
  2. Open a command line and execute the java -version command.
    You should see Java 11 printed, indicating that any Java process starts by default using the Java 11 executable defined in the PATH.
  3. If not done yet, add the path to your Java 17 instance to your JAVA_HOME environment variable.
  4. Go to the directory where Talend JobServer is installed, and open the start_rs.bat file to edit it.
  5. Change set MY_JAVA=java to set MY_JAVA=%JAVA_HOME%/bin/java, ensuring that your Talend JobServer starts with Java 17 defined in JAVA_HOME.
  6. Repeat this operation in the stop_rs.bat file.

Results

The next time you launch Talend JobServer, it will use Java 17 to start and Java 11 to execute Jobs.
Information noteNote: Alternatively, you can use the Job launcher path parameter to define a Java instance to use, though this is not recommended due to its lack of portability. To do this,
  1. Go to the directory <root>/conf/, where <root> is the Talend JobServer path, and open the TalendJobServer.properties file to edit it.

  2. In the line dedicated to the Job launcher path, add the path to your Java executable after the equal sign.
    # Set the executable path of the binary which will run the job, for example: /usr/bin/java/java or "c:\\Program Files\\Java\\bin\\java.exe"
                                    org.talend.remote.jobserver.commons.config.JobServerConfiguration.JOB_LAUNCHER_PATH="C:\\Program Files\\Java\\jdk11.0.13\\bin\\java.exe"

    The use of quotes is only necessary when your path contains spaces, as shown in the capture. Otherwise, enter the path without quotes.

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!