I am attempting to install OpenJDK on my headless server running Ubuntu 20.04. I've done this before on older versions of Ubuntu, but as it had been a while since then, I couldn't remember the package name. I put in the java
command so that I could find the correct package name, and I received this:
Command 'java' not found, but can be installed with:
sudo apt install default-jre # version 2:1.11-72, or
sudo apt install openjdk-11-jre-headless # version 11.0.7+10-3ubuntu1
sudo apt install openjdk-8-jre-headless # version 8u252-b09-1ubuntu1
I wanted OpenJDK 8, so I put in sudo apt install openjdk-8-jre-headless
and hit enter, expecting it to be installed. Instead, I received this:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-8-headless
I don't understand why the package can't be located. I've done everything I can think of, and I can't seem to find anyone else having this problem, so any help would be greatly appreciated. Thanks for your time!