diegocastro.ar

Systems Administrator | IT Infrastructure | Internal Auditor ISO/IEC 27001 | Networking | Linux & Windows servers

How to properly install Temurin JDK with update-alternatives

You can use the Adoptium Debian / Ubuntu repository

  1. Add the Eclipse Adoptium GPG key
    wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo apt-key add -
    
  2. Add the Eclipse Adoptium apt repository
    echo "deb https://packages.adoptium.net/artifactory/deb $(awk -F= '/^VERSION_CODENAME/{print$2}' /etc/os-release) main" | sudo tee /etc/apt/sources.list.d/adoptium.list
    
  3. Install the Temurin version you require
    sudo apt update # update if you haven't already
    sudo apt install temurin-21-jdk
    
  4. Configure the default version
    sudo update-alternatives --config java

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.