How to easily install Eclipse and JDK on Ubuntu 21.04

Simone Cognolato
2 min readJul 22, 2021

This post originally appeared on the Simonec96 Wiki Page at https://www.simonec96.com/wiki/installing-eclipse-jdk-11-ubuntu-21-04/

Dealing and installing JDK can, sometimes, be annoying. Here’s a quick guide on how to install Java Development Kit (JDK) and Eclipse on Ubuntu 21.04 in an easy way. Thus open your terminal and follow these steps:

1: Check if you have Java Installed:

java --version

2. If you don’t have Java installed, then you’ll probably see:

Command 'java' not found, but can be installed with:
sudo apt install openjdk-11-jre-headless # version 11.0.11+9-0ubuntu2, or
sudo apt install default-jre # version 2:1.11-72
sudo apt install openjdk-15-jre-headless # version 15.0.3+3-1
sudo apt install openjdk-16-jre-headless # version 16.0.1+9-1
sudo apt install openjdk-17-jre-headless # version 17~19-1ubuntu1
sudo apt install openjdk-8-jre-headless # version 8u292-b10-0ubuntu1

3. Install OpenJDK 11: (in the end of this wiki you’ll find a reasoning on why choosing JDK 11)

sudo apt install openjdk-11-jre-headless

4. Download the Eclipse Installer from the official website by visiting https://www.eclipse.org/downloads/

5. Extract the .tar.gz archive, enter inside the extracted folder, enter inside “eclipse-installer” folder, then right-click on file “eclipse-inst” and press “run”.

6. Proceed with the Installation Wizard and you should not encounter any problems if you have installed JDK, as previously shown, successfully.

7. You’re done! Enjoy.

* Why JDK 11? Oracle is releasing almost 2 new Java versions per year, as you can see in the Java version history on Wikipedia, but just some of them are Long Term Support (LTS) versions. This means, that LTS releases will be supported for many years and will become standards in the development. The last super popular LTS version was Java JDK 8, but Oracle stopped the support in the end of 2019. This lead to the new popular version which is the JDK 11. In some months, thus in September 2021 (currently when I’m writing this wiki is July 2021) Java JDK 17 will be released as LTS, but it will take some months or years to be adopted and supported by the majority of the computers. This means, JDK 11 will stay as the standard for some years for sure.

--

--