The Java Development Kit (JDK) is a package that contains the tools and libraries you need to develop Java applications. It includes the Java Runtime Environment (JRE), as well as the javac
compiler and other tools for debugging and testing Java applications.
To install the JDK on Ubuntu, you can use the apt-get
command. For example, to install the OpenJDK 11 JDK, you can run the following command:
sudo apt-get install openjdk-11-jdk
This will install the OpenJDK 11 package and set it as the default Java runtime and compiler.
Note: If you want to install a different version of the JDK, you can specify the version number in the package name. For example, to install OpenJDK 8, you can run the following command:
sudo apt-get install openjdk-8-jdk
After the JDK is installed, you can check the version by running the java -version
and javac -version
commands.