OpenJDK is a stable, free, and open source Java development kit. This package will be required for everything related to code compilation and runtime environments.
Also, it is possible to use an Oracle JDK, but you should pay attention to the License and Agreements.
To install OpenJDK, we will open a terminal and run the following command:
sudo apt-get install openjdk-8-jdk -y
Check the installation using the following command:
java -version
You should see the OpenJDK version and its relevant details displayed as follows:
Now that we have installed the Java development kit, we ...