# Upgrading Java for all Talend services

You can upgrade Java to avoid security issues. This procedure will go through the different steps required for minor or major updates of Java on Talend services. It can also be followed for minor downgrades.

## Before you begin

* Download and extract the [update_java.zip](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/Content/Resources/attachments/update_java.zip) file. Use the .bat file or the .sh file depending on your operating system.
* On Windows, download the [sed.zip](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/Content/Resources/attachments/sed.zip) archive only if there is no such file in the utils folder in the Talend home folder.

## About this task

The procedures to update all Talend services exclude Talend Remote Engine, because this service requires different steps. For more information, see [Changing Java instances for Remote Engine services](https://help.qlik.com/talend/en-US/installation-guide-linux/Cloud/java-setup-and-pptimization-for-remote-engine-service#changing-java-instances-for-remote-engine-service).

Upgrading to another major version of Java may require additional steps to ensure that your Talend artifacts are compatible with the newer Java version. For an example of upgrading from Java 8 or 11 to a more recent Java version (17 or 21), see [Using a more recent version of Java](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/migrating-artifacts-to-use-java-17 "The best practice is to use Talend products with the most recent supported versions of Java.").

Information noteRestriction: Talend LogServer (deprecated) and Nexus do not support Java 17 or Java 21. Nexus does not support Java 11.

## Upgrading Java for all Talend services on Linux

### Procedure

1. Install the new Java version according to the [Compatible Java environments](https://help.qlik.com/talend/en-US/installation-guide-linux/8.0/compatible-java-environments) page, but do not uninstall or delete the old Java version yet.

   Removing the old Java version before running this script can cause some Talend services to fail to start after updating Java.
2. Find all the running Talend services with the command systemctl | grep talend.
3. Stop all Talend services with the command systemctl stop &lt;service name&gt;.
4. Open [update_java.sh](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/Content/Resources/attachments/update_java.sh) with a text editor.
5. Locate the variables in the script and set them as follows:

   TALEND\_HOME=&lt;Talend\_home\_folder&gt; (for example: TALEND\_HOME=/opt/Talend-8.0.1)

   PROD\_VER=&lt;Talend\_version&gt; (for example: PROD\_VER=8.0.1)

   JAVA\_HOME=&lt;Java\_home\_folder&gt; (for example: JAVA\_HOME=/usr/lib/jvm/jre1.8.0\_221)
6. As a superuser, run [update_java.sh](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/Content/Resources/attachments/update_java.sh). This script will replace the hard-coded path to Java with the new values in your installation.
7. Restart your computer or start all Talend services manually with the command systemctl start &lt;service name&gt;.
8. Optional: After you started all services successfully, you can remove the old Java version if it is not used by other software.

### Results

All Talend services, except Talend Remote Engine, are now using the new Java version.

## Upgrading Java for all Talend services on Windows

### Procedure

1. Place the [update_java.bat](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/Content/Resources/attachments/update_java.bat) file in the utils folder in the Talend home folder.
2. If you downloaded the [sed.zip](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/Content/Resources/attachments/sed.zip), place it in the utils folder.
3. Install the new Java version according to the [Compatible Java environments](https://help.qlik.com/talend/en-US/installation-guide-linux/8.0/compatible-java-environments) page, but do not uninstall or delete the old Java version yet.

   Removing the old Java version before running this script can cause some Talend services to fail to start after updating Java.
4. In Windows search tab, type in services.msc and open the Microsoft Management Console application.
5. Look for the list of Talend services, right-click each of them and select Stop.

   The last services to be stopped should be Talend Administration Center, Talend Identity and Access Management, then Kafka, ZooKeeper, and MongoDB.
6. Go to System Properties &gt; Advanced &gt; Environments Variables.
7. Update the JAVA\_HOME environment variable and the PATH variable:
   1. Under System Variables, click New... to create a variable. Name the variable JAVA\_HOME, enter the path to your Java environment, and click OK.
   1. Under System Variables, select the Path variable, click Edit... and add the following variable at the end of the Path variable value: ;%JAVA\_HOME%\bin
8. Open the command prompt application.
9. Type in echo %JAVA\_HOME% and press Enter. The value displayed is the new value set.
10. Open [update_java.bat](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/Content/Resources/attachments/update_java.bat) with a text editor.
11. Locate the variables in the script and set them as follows:

    "TALEND\_HOME=C:\&lt;Talend\_home\_folder&gt;" (for example: set "TALEND\_HOME=C:\Talend\8.0.1")

    "PROD\_VER=&lt;Talend\_version&gt;" (for example: set "PROD\_VER=8.0.1")
12. Add --add-opens=java.base/java.lang=ALL-UNNAMED in the setenv.bat file, if you have not yet this configuration.

    Then run the following command as administrator to start Talend Administration Center service:
    ```
    cd C:\Talend\8.0.1\tac\apache-tomcat\bin
    tomcat9.exe //US//talend-tac-8.0.1 ++JvmOptions="--add-opens=java.base/java.lang=ALL-UNNAMED
    ```
13. As a superuser, run [update_java.bat](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/Content/Resources/attachments/update_java.bat). This script will replace the hard-coded path to Java with the new values in your installation.
14. Restart your computer or start all Talend services manually from the service.msc application.
15. Optional: After you started all services successfully, you can remove the old Java version if it is not used by other software.

### Results

All Talend services, except Talend Remote Engine, are now using the new Java version.

### In this section

* [Using a more recent version of Java](https://help.qlik.com/talend/en-US/migration-upgrade-guide/8.0/migrating-artifacts-to-use-java-17)