Java 17.x Upgrade (Windows)

Upgrading the Java Development Kit (JDK) is critical for maintaining security, performance, and compatibility with modern Java applications. This document provides step-by-step instructions for upgrading Java to JDK 17.0.15+6 on a Windows machine, reconfiguring environment variables, and reintegrating the JDK with an existing Apache Tomcat service.

Prerequisites

Before starting the upgrade, ensure the following:

  • Administrator access to the Windows machine.

  • Backup of current Tomcat configuration, including Java Options and Heap Size.

  • Tomcat service is stopped before upgrade.

  • Internet access available to download the JDK installer.

Upgrade Process Steps

  1. Stop and Backup Tomcat Configuration

    • Open Services → Locate the Tomcat service → Right-click → Stop.

    • Navigate to the Tomcat bin directory.

    • Open Command Prompt in that directory and run:

      tomcat10w.exe //ES//<TomcatServiceName>

      Sample Reference Screenshot:

      (Replace <TomcatServiceName> with your actual Tomcat service name).

    • In the Java tab, note down:

      • Java Options

      • Heap Size values (Copy to a Notepad for later reference).

    • Uninstall the existing Tomcat service:

      service.bat remove <TomcatServiceName>

      Sample Reference Screenshot:

  1. Uninstall Previous JDK Version

    • Open Control Panel → Programs → Programs and Features.

    • Locate the existing Java/JDK installation.

    • Right-click → Uninstall.

  2. Download and Install JDK 17.0.15+6

  3. Set Environment Variables

    • Press Windows Key → Search for Environment Variables → Open Edit the system environment variables.

    • Click Environment Variables.

      • Under System Variables → New:

        • Variable Name: JAVA_HOME

        • Variable Value:

          C:\Program Files\OpenLogic\jdk-17.0.15.6-hotspot

      • Under System Variables → Path → Edit: Ensure the following entry exists:

        • C:\Program Files\OpenLogic\jdk-17.0.15.6-hotspot\bin

  4. Verify Java Installation

    • Open Command Prompt and run:

      java -version
    • Expected output:

      openjdk version "17.0.15" 2024-04-16
      OpenLogic OpenJDK Runtime Environment ...

      Sample Reference Screenshot:

  5. Reconfigure Tomcat Service

    • Navigate to Tomcat’s bin directory:

      cd C:\ovaledge\apache-tomcat-10.1.40\bin
    • Reinstall the Tomcat service:

      service.bat install <TomcatServiceName>
    • Open Tomcat configuration:

      tomcat10w.exe //ES//<TomcatServiceName>

      Sample Reference Screenshot:

    • Under the Java tab:

      • Restore previously saved Java Options and Heap Size.

      • Update paths if necessary (e.g., externalized log4j.properties).

    • Under the General tab:

      • Set Startup Type → Automatic (Delayed Start).

    • Return to Services → Locate Tomcat service → Start.

Validation

After Tomcat is started:

  • Review catalina.out or stdout/stderr logs for errors.

  • Confirm application accessibility through the web interface.

  • Verify environment variables:

    echo %JAVA_HOME%
  • Ensure it points to the new JDK directory.


Copyright © 2025, OvalEdge LLC, Peachtree Corners, GA, USA.

Last updated

Was this helpful?