Featured

Installing Adoptium (AdoptOpenJDK) on Linux Mint 20.3

Somehow I broke my Java runtime on my Linux Mint 20.3 computer. I think it had something to do with the fact that I started a release upgrade to go to 21, that didn't complete. I never went back and fixed it thinking I would do it later, and then later came and my Java install was broken.

I decided that I wanted to try and install AdoptOpenJDK so I could have a bit newer version than was supported by the distribution.

The Linux Mint Forums were talking about that it was best to install from the default package repository (https://forums.linuxmint.com/viewtopic.php?f=47&t=381175&p=2228166&hilit=Adoptium#p2228166). Normally I would agree if you just want it to work and be done with it, but I was in the mood to get the third party version working. I have run into needing a newer version of Java than the default package repository provided before.

To work out how to install it I came across the answer on the ask ubuntu question about installing Adoptium (AdoptOpenJDK) on Ubuntu. That led me to the documentation for installing on Debian or Ubuntu on the Adoptium website. Following the instructions there I got an error message complaining that the package repository for adoptium didn't have a release for una (See full error message below.

E: The repository 'https://packages.adoptium.net/artifactory/deb una Release' does not have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

I finally realized that the install instructions step 3 was writing una as the distro name in the /etc/apt/sources.list.d/adoptium.list file. Adoptium didn't have support for that distro name and so I was able to get it to install by changing that to the ubuntu name (focal in my case), since Linux Mint is mostly just repackaged Ubuntu.

Final version of the /etc/apt/sources.list.d/adoptium.list just has the one line below.

deb https://packages.adoptium.net/artifactory/deb focal main

The ubuntu name to use can be found on the Linux Mint versions page as package base. https://linuxmint.com/download_all.php

I was then able to run the sudo apt update and then sudo apt install temurin-19-jdk. After closing and reopening my terminal java --version showed

OpenJDK Temurin 19.
openjdk 19 2022-09-20
OpenJDK Runtime Environment Temurin-19+36 (build 19+36)
OpenJDK 64-Bit Server VM Temurin-19+36 (build 19+36, mixed mode, sharing)

I hope this helps someone, but it was written mostly as a note to myself on how to install it in case I have need of it in the future.