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)


Subscribe with Valid Email Id to receive updates in Inbox. ( Secured by Google FeedBurner )


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

Leave a Comment

Android Android Build system Android Commands Android Java Applications 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 & Build Development, Debugging and Performance Tools 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 Audio, Video, Images NDK / Middleware / HAL OS 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 / Bitbake / Openembedded