This tutorial will help you install Java Development Kit or JDK on Ubuntu 24.04. This is required for you to do software development in Java programming language because it contains the compiler and Java Virtual Machine alias JVM as well as the libraries. It is not to be confused with JRE, as JRE is required only for running, while JDK is required for creating Java applications. Finally, we will install OpenJDK, the free software implementation of Java default to Ubuntu and let's continue reading.
Subscribe to UbuntuBuzz Telegram Channel to get article updates.
How To Install OpenJDK
1. Run Terminal.
2. Type a command line below followed by Enter:
$ sudo apt-get install default-jdk
3. Let the installation process taking place.
4. Installation finished. Done.
5. Check your JDK installation by command lines below:
$ java --version
$ javac --version
$ man javac
Sample outputs:
Click to enlarge picture.
(a) The install command. |
(b) Installation process takes place and finished. |
(c) Verifying JDK installation. |
(d) Verifying JDK installation by reading javac manual. |
Now you are ready for Java programming as well as installing development tools such as Netbeans, Eclipse etc. As for our recommendation, students can start their studying using Geany IDE that is fast and lightweight for Java.
****
Notes
On Ubuntu 20.04, the version is OpenJDK 11 and this process will download 100MB and require 90MB free disk space.
On Ubuntu 24.04, the version is OpenJDK 21 and this process will download 190MB and require +/-300MB free disk space.
****
This article is licensed under CC BY-SA 3.0.