How to Install Java using apt-get command on Ubuntu ?

Installing JAVA on ubuntu can be done using following easiest command. for Ubuntu 20.04, this command installs OpenJDK 8 as we can see details in additional packages installed.

$ sudo apt-get install default-jdk 

The following additional packages will be installed:

The following additional packages will be installed:
  default-jdk-headless default-jre default-jre-headless
The following NEW packages will be installed:
  default-jdk default-jdk-headless default-jre default-jre-headless

Now, you can check the version of JAVA installed on your Ubuntu.

$  java -version
openjdk version "1.8.0_275"
OpenJDK Runtime Environment (build 1.8.0_275-8u275-b01-0ubuntu1~18.04-b01)
OpenJDK 64-Bit Server VM (build 25.275-b01, mixed mode)
Project On Hospital Management Syst... x
Project On Hospital Management System In Java With Source Code

2 thoughts on “How to Install Java using apt-get command on Ubuntu ?”

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development, Debugging and Performance Tools Development and Build Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web Design and Development Website Hosting Wordpress Yocto Embedded Linux