You can use the Adoptium Debian / Ubuntu repository
- Add the Eclipse Adoptium GPG key
wget -O - https://packages.adoptium.net/artifactory/api/gpg/key/public | sudo apt-key add -
- 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
- Install the Temurin version you require
sudo apt update # update if you haven't already sudo apt install temurin-21-jdk
- Configure the default version
sudo update-alternatives --config java
Leave a Reply