Skip to main content
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT

Best practices for running JDK 8, 11, and 17 on Linux

No ratings
Showing results for 
Search instead for 
Did you mean: 
Contributor II
Contributor II

Best practices for running JDK 8, 11, and 17 on Linux

Last Update:

Nov 6, 2023 10:38:12 AM

Updated By:


Created date:

Nov 6, 2023 10:38:12 AM


This article tells you how to configure your Jobs, JobServer, and a Remote Engine to use JDK 8, 11, and 17 on Linux.

How Linux distributions work with the Java binary

Linux distributions do not add JAVA_HOME/bin in the path. Instead, there is a Java executable in /usr/bin. This binary is a symbolic link to /etc/alternatives/java, which is a symbolic link to /usr/lib/jvm/JDK-version/bin/java. Setting JAVA_HOME is not required to use Java, because it works out of the box.

$ java -version
openjdk version "11.0.20" 2023-07-18 LTS
OpenJDK Runtime Environment (Red_Hat- (build 11.0.20+8-LTS)
OpenJDK 64-Bit Server VM (Red_Hat- (build 11.0.20+8-LTS, mixed mode, sharing)

$ which java

$ ls -l /usr/bin/java
lrwxrwxrwx 1 root root 22 Oct 18 10:47 /usr/bin/java -> /etc/alternatives/java

$ ls -l /etc/alternatives/java
lrwxrwxrwx 1 root root 62 Oct 26 10:58 /etc/alternatives/java -> /usr/lib/jvm/java-11-openjdk-

To change the release to run by default, you must change the symbolic link /etc/alternatives/java by replacing it with the command update-alternatives --config java.

$sudo  update-alternatives --config java

There are 2 programs which provide 'java'.

  Selection    Command
*+ 1           java-11-openjdk.x86_64 (/usr/lib/jvm/java-11-openjdk-
   2           java-17-openjdk.x86_64 (/usr/lib/jvm/java-17-openjdk-

Enter to keep the current selection[+], or type selection number:

This implementation means that all JAR files you run with a Java command will only use the system default Java. This also works for JDK installed with a package manager (APT or YUM).

You can add manually-installed JDK using the following command:

$sudo update-alternatives --install /usr/bin/java java /opt/portable-jdk/bin/java 0


$sudo ln -s /opt/portable-jdk/bin/java /etc/alternatives/java 


How Talend software works with Java

Talend Remote Engine

Before installing the Remote Engine, you must update JAVA_HOME to a JDK path. JDK uses this variable to run the Remote Engine and it is stored on the wrapper.conf file. 
# more talend-remote-engine-wrapper.conf

You can change this value to the new Java path when the Remote Engine is stopped.


# more

How to use different Java for Jobs, Remote Engines, and JobServers

In summary, when using different Java for Jobs, JobServers, and Remote Engines:

The system default Java code will be the Java that runs the Job. The update-alternatives --config Java command makes you select the JDK to run the Jobs.

The Remote Engine uses the JAVA_HOME variable set just before installation in the configuration file, and JobServer uses the Java in the configuration file.

This means the Jobs use /usr/bin/java and the Remote Engine or JobServer uses JAVA_HOME/bin/java.
Version history
Last update:
‎2023-11-06 10:38 AM
Updated by: