By bengaltiger
Hi,
When I tried to install Java package that is required for Jenkins install I see the following error and there is no clue how to get unblocked from this error. OS on the droplet is Ubuntu 18.04.
$ sudo apt install default-jre
Reading package lists... Done
Building dependency tree
Reading state information... Done
**E: Unable to locate package default-jre**
$ java --version
Command 'java' not found, but can be installed with:
sudo apt install openjdk-11-jre-headless # version 11.0.7+10-2ubuntu2~19.10, or
sudo apt install default-jre # version 2:1.11-72
sudo apt install openjdk-13-jre-headless # version 13+33-1
sudo apt install openjdk-14-jre-headless # version 14~18-1
sudo apt install openjdk-8-jre-headless # version 8u252-b09-1~19.10
$ sudo apt install openjdk-11-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-11-jre-headless
$
$ sudo apt install openjdk-14-jre-headless
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package openjdk-14-jre-headless
$
$ sudo apt openjdk-8-jre-headless
E: Invalid operation openjdk-8-jre-headless
$
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hi @bengaltiger,
The easiest option for installing Java is to use the version packaged with Ubuntu. By default, Ubuntu 18.04 includes OpenJDK version 11, which is an open-source variant of the JRE and JDK.
To install this version, first update the package index:
sudo apt update
After the update give
sudo apt install default-jre
Another try
Regards, KFSys
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.