Install Java Runtime Environment (Oracle or open JRE) on Ubuntu


Java Runtime Environment i.e JRE is required on your Ubuntu Operating System if you want to run and execute Java programs. Before you install JRE, you must know which version you want to install, there are two flavors that you can choose from Oracle JRE or Open JRE.

Let's see how we can install them using terminal commands,

  1. Open Terminal,
  2. Type command sudo apt install openjdk-8-jre,
  3.  $ sudo apt install openjdk-8-jre
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Unable to locate package openjdk-8-jre
     $
    

    If you get the above error, you need to update your apt, type sudo apt-get update

  4. You will get the following logs,
  5.  $ sudo apt install openjdk-8-jre
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following additional packages will be installed:
      adwaita-icon-theme at-spi2-core ca-certificates-java fontconfig fonts-dejavu-extra gtk-update-icon-cache
      hicolor-icon-theme humanity-icon-theme java-common libatk-bridge2.0-0 libatk-wrapper-java libatk-wrapper-java-jni
      libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data libavahi-common3 libcairo-gobject2
      libcairo2 libcups2 libdatrie1 libgail-common libgail18 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin
      libgdk-pixbuf2.0-common libgif7 libgraphite2-3 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libharfbuzz0b libjbig0
      libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
      libpcsclite1 libpixman-1-0 librsvg2-2 librsvg2-common libthai-data libthai0 libtiff5 libwebp6 libxcb-render0
      libxcb-shm0 libxcursor1 openjdk-8-jre-headless ubuntu-mono
    Suggested packages:
      default-jre cups-common gvfs liblcms2-utils pcscd librsvg2-bin icedtea-8-plugin libnss-mdns fonts-ipafont-gothic
      fonts-ipafont-mincho fonts-wqy-microhei fonts-wqy-zenhei fonts-indic
    The following NEW packages will be installed:
      adwaita-icon-theme at-spi2-core ca-certificates-java fontconfig fonts-dejavu-extra gtk-update-icon-cache
      hicolor-icon-theme humanity-icon-theme java-common libatk-bridge2.0-0 libatk-wrapper-java libatk-wrapper-java-jni
      libatk1.0-0 libatk1.0-data libatspi2.0-0 libavahi-client3 libavahi-common-data libavahi-common3 libcairo-gobject2
      libcairo2 libcups2 libdatrie1 libgail-common libgail18 libgdk-pixbuf2.0-0 libgdk-pixbuf2.0-bin
      libgdk-pixbuf2.0-common libgif7 libgraphite2-3 libgtk2.0-0 libgtk2.0-bin libgtk2.0-common libharfbuzz0b libjbig0
      libjpeg-turbo8 libjpeg8 liblcms2-2 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libpangoft2-1.0-0
      libpcsclite1 libpixman-1-0 librsvg2-2 librsvg2-common libthai-data libthai0 libtiff5 libwebp6 libxcb-render0
      libxcb-shm0 libxcursor1 openjdk-8-jre openjdk-8-jre-headless ubuntu-mono
    0 upgraded, 56 newly installed, 0 to remove and 163 not upgraded.
    Need to get 43.5 MB of archives.
    After this operation, 173 MB of additional disk space will be used.

    Do you want to continue? [Y/n] type y or Y

  6. You will see logs like this,
  7. Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 hicolor-icon-theme all 0.17-2 [9976 B]
    Get:2 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libjpeg-turbo8
     amd64 2.0.3-0ubuntu1.20.04.1 [117 kB]
    Get:3 http://archive.ubuntu.com/ubuntu focal/main amd64 libjpeg8 amd64 8c-2ubuntu8 [2194 B]
    Get:4 http://archive.ubuntu.com/ubuntu focal/main amd64 libjbig0 amd64 2.1-3.1build1 [26.7 kB]
    Get:5 http://archive.ubuntu.com/ubuntu focal/main amd64 libwebp6 amd64 0.6.1-2 [185 kB]
    Get:6 http://archive.ubuntu.com/ubuntu focal/main amd64 libtiff5 amd64 4.1.0+git191117-2build1 [161 kB]
    Get:7 http://archive.ubuntu.com/ubuntu focal/main amd64 libgdk-pixbuf2.0-common all 2.40.0+dfsg-3 [4896 B]
    .
    .
    .
    Get:11 http://archive.ubuntu.com/ubuntu focal/main amd64 libxcb-render0 amd64 1.14-2 [14.8 kB]
    Get:12 http://archive.ubuntu.com/ubuntu focal/main amd64 libxcb-shm0 amd64 1.14-2 [5584 B]
    Get:13 http://archive.ubuntu.com/ubuntu focal/main amd64 libcairo2 amd64 1.16.0-4ubuntu1 [583 kB]
    Get:14 http://archive.ubuntu.com/ubuntu focal/main amd64 libcairo-gobject2 amd64 1.16.0-4ubuntu1 [17.2 kB]
    Get:15 http://archive.ubuntu.com/ubuntu focal/main amd64 fontconfig amd64 2.13.1-2ubuntu3 [171 kB]
    Get:16 http://archive.ubuntu.com/ubuntu focal/main amd64 libgraphite2-3 amd64 1.3.13-11build1 [73.5 kB]
    Get:17 http://archive.ubuntu.com/ubuntu focal/main amd64 libharfbuzz0b amd64 2.6.4-1ubuntu4 [391 kB]
    Get:18 http://archive.ubuntu.com/ubuntu focal/main amd64 libthai-data all 0.1.28-3 [134 kB]
    .
    .
    .
    Get:29 http://archive.ubuntu.com/ubuntu focal/main amd64 libatspi2.0-0 amd64 2.36.0-2 [64.2 kB]
    Get:30 http://archive.ubuntu.com/ubuntu focal/main amd64 at-spi2-core amd64 2.36.0-2 [48.7 kB]
    Get:31 http://archive.ubuntu.com/ubuntu focal/main amd64 java-common all 0.72 [6816 B]
    Get:32 http://archive.ubuntu.com/ubuntu focal/main amd64 libavahi-common-data amd64 0.7-4ubuntu7 [21.4 kB]
    Get:33 http://archive.ubuntu.com/ubuntu focal/main amd64 libavahi-common3 amd64 0.7-4ubuntu7 [21.7 kB]
    Get:34 http://archive.ubuntu.com/ubuntu focal/main amd64 libavahi-client3 amd64 0.7-4ubuntu7 [25.5 kB]
    Get:35 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 libcups2 amd64 2.3.1-9ubuntu1.1 [233 kB]
    Get:36 http://archive.ubuntu.com/ubuntu focal/main amd64 liblcms2-2 amd64 2.9-4 [140 kB]
    .
    .
    Get:41 http://archive.ubuntu.com/ubuntu focal/main amd64 ca-certificates-java all 20190405ubuntu1 [12.2 kB]
    Get:42 http://archive.ubuntu.com/ubuntu focal/main amd64 fonts-dejavu-extra all 2.37-1 [1953 kB]
    Get:43 http://archive.ubuntu.com/ubuntu focal/main amd64 libatk1.0-data all 2.35.1-1ubuntu2 [2964 B]
    Get:44 http://archive.ubuntu.com/ubuntu focal/main amd64 libatk1.0-0 amd64 2.35.1-1ubuntu2 [45.5 kB]
    Get:46 http://archive.ubuntu.com/ubuntu focal/main amd64 libatk-wrapper-java all 0.37.1-1 [53.0 kB]
    Get:47 http://archive.ubuntu.com/ubuntu focal/main amd64 libatk-wrapper-java-jni amd64 0.37.1-1 [45.1 kB]
    .
    .
    Fetched 43.5 MB in 1min 41s (432 kB/s)
    Extracting templates from packages: 100%
    Selecting previously unselected package hicolor-icon-theme.
    (Reading database ... 31836 files and directories currently installed.)
    Preparing to unpack .../00-hicolor-icon-theme_0.17-2_all.deb ...
    Unpacking hicolor-icon-theme (0.17-2) ...
    Selecting previously unselected package libjpeg-turbo8:amd64.
    Preparing to unpack .../01-libjpeg-turbo8_2.0.3-0ubuntu1.20.04.1_amd64.deb ...
    Unpacking libjpeg-turbo8:amd64 (2.0.3-0ubuntu1.20.04.1) ...
    Selecting previously unselected package libjpeg8:amd64.
    Preparing to unpack .../02-libjpeg8_8c-2ubuntu8_amd64.deb ...
    Unpacking libjpeg8:amd64 (8c-2ubuntu8) ...
    Selecting previously unselected package libjbig0:amd64.
    Preparing to unpack .../03-libjbig0_2.1-3.1build1_amd64.deb ...
    Unpacking libjbig0:amd64 (2.1-3.1build1) ...
    Selecting previously unselected package libwebp6:amd64.
    Preparing to unpack .../04-libwebp6_0.6.1-2_amd64.deb ...
    Unpacking libwebp6:amd64 (0.6.1-2) ...
    Selecting previously unselected package libtiff5:amd64.
    Preparing to unpack .../05-libtiff5_4.1.0+git191117-2build1_amd64.deb ...
    Unpacking libtiff5:amd64 (4.1.0+git191117-2build1) ...
    Selecting previously unselected package libgdk-pixbuf2.0-common.
    Preparing to unpack .../06-libgdk-pixbuf2.0-common_2.40.0+dfsg-3_all.deb ...
    Unpacking libgdk-pixbuf2.0-common (2.40.0+dfsg-3) ...
    Selecting previously unselected package libgdk-pixbuf2.0-0:amd64.
    Preparing to unpack .../07-libgdk-pixbuf2.0-0_2.40.0+dfsg-3_amd64.deb ...
    Unpacking libgdk-pixbuf2.0-0:amd64 (2.40.0+dfsg-3) ...
    Selecting previously unselected package gtk-update-icon-cache.
    Preparing to unpack .../08-gtk-update-icon-cache_3.24.20-0ubuntu1_amd64.deb ...
    No diversion 'diversion of /usr/sbin/update-icon-caches to 
    /usr/sbin/update-icon-caches.gtk2 by libgtk-3-bin', none removed.
    No diversion 'diversion of /usr/share/man/man8/update-icon-caches.8.gz
     to /usr/share/man/man8/update-icon-caches.gtk2.8.gz by libgtk-3-bin
    Unpacking gtk-update-icon-cache (3.24.20-0ubuntu1) ...
    Selecting previously unselected package libpixman-1-0:amd64.
    Preparing to unpack .../09-libpixman-1-0_0.38.4-0ubuntu1_amd64.deb ...
    Unpacking libpixman-1-0:amd64 (0.38.4-0ubuntu1) ...
    Selecting previously unselected package libxcb-render0:amd64.
    Preparing to unpack .../10-libxcb-render0_1.14-2_amd64.deb ...
    Unpacking libxcb-render0:amd64 (1.14-2) ...
    Selecting previously unselected package libxcb-shm0:amd64.
    Preparing to unpack .../11-libxcb-shm0_1.14-2_amd64.deb ...
    Unpacking libxcb-shm0:amd64 (1.14-2) ...
    Selecting previously unselected package libcairo2:amd64.
    Preparing to unpack .../12-libcairo2_1.16.0-4ubuntu1_amd64.deb ...
    Unpacking libcairo2:amd64 (1.16.0-4ubuntu1) ...
    Selecting previously unselected package libcairo-gobject2:amd64.
    Preparing to unpack .../13-libcairo-gobject2_1.16.0-4ubuntu1_amd64.deb ...
    Unpacking libcairo-gobject2:amd64 (1.16.0-4ubuntu1) ...
    Selecting previously unselected package fontconfig.
    Preparing to unpack .../14-fontconfig_2.13.1-2ubuntu3_amd64.deb ...
    Unpacking fontconfig (2.13.1-2ubuntu3) ...
    Selecting previously unselected package libgraphite2-3:amd64.
    Preparing to unpack .../15-libgraphite2-3_1.3.13-11build1_amd64.deb ...
    Unpacking libgraphite2-3:amd64 (1.3.13-11build1) ...
    Selecting previously unselected package libharfbuzz0b:amd64.
    Preparing to unpack .../16-libharfbuzz0b_2.6.4-1ubuntu4_amd64.deb ...
    Unpacking libharfbuzz0b:amd64 (2.6.4-1ubuntu4) ...
    Selecting previously unselected package libthai-data.
    Preparing to unpack .../17-libthai-data_0.1.28-3_all.deb ...
    Unpacking libthai-data (0.1.28-3) ...
    Selecting previously unselected package libdatrie1:amd64.
    Preparing to unpack .../18-libdatrie1_0.2.12-3_amd64.deb ...
    Unpacking libdatrie1:amd64 (0.2.12-3) ...
    Selecting previously unselected package libthai0:amd64.
    Preparing to unpack .../19-libthai0_0.1.28-3_amd64.deb ...
    Unpacking libthai0:amd64 (0.1.28-3) ...
    Selecting previously unselected package libpango-1.0-0:amd64.
    Preparing to unpack .../20-libpango-1.0-0_1.44.7-2ubuntu4_amd64.deb ...
    Unpacking libpango-1.0-0:amd64 (1.44.7-2ubuntu4) ...
    Selecting previously unselected package libpangoft2-1.0-0:amd64.
    Preparing to unpack .../21-libpangoft2-1.0-0_1.44.7-2ubuntu4_amd64.deb ...
    Unpacking libpangoft2-1.0-0:amd64 (1.44.7-2ubuntu4) ...
    Selecting previously unselected package libpangocairo-1.0-0:amd64.
    Preparing to unpack .../22-libpangocairo-1.0-0_1.44.7-2ubuntu4_amd64.deb ...
    Unpacking libpangocairo-1.0-0:amd64 (1.44.7-2ubuntu4) ...
    .
    .
    head: cannot open '/etc/ssl/certs/java/cacerts' for reading: No such file or directory
    Adding debian:ACCVRAIZ1.pem
    Adding debian:AC_RAIZ_FNMT-RCM.pem
    Adding debian:Actalis_Authentication_Root_CA.pem
    Adding debian:AddTrust_External_Root.pem
    Adding debian:AffirmTrust_Commercial.pem
    Adding debian:AffirmTrust_Networking.pem
    Adding debian:AffirmTrust_Premium.pem
    Adding debian:AffirmTrust_Premium_ECC.pem
    Adding debian:Amazon_Root_CA_1.pem
    Adding debian:Amazon_Root_CA_2.pem
    Adding debian:Amazon_Root_CA_3.pem
    Adding debian:Amazon_Root_CA_4.pem
    Adding debian:Atos_TrustedRoot_2011.pem
    Adding debian:Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068.pem
    Adding debian:Baltimore_CyberTrust_Root.pem
    Adding debian:Buypass_Class_2_Root_CA.pem
    Adding debian:Buypass_Class_3_Root_CA.pem
    Adding debian:CA_Disig_Root_R2.pem
    Adding debian:CFCA_EV_ROOT.pem
    Adding debian:COMODO_Certification_Authority.pem
    Adding debian:COMODO_ECC_Certification_Authority.pem
    Adding debian:COMODO_RSA_Certification_Authority.pem
    Adding debian:Certigna.pem
    Adding debian:Certinomis_-_Root_CA.pem
    Adding debian:Certplus_Class_2_Primary_CA.pem
    Adding debian:Certum_Trusted_Network_CA.pem
    Adding debian:Certum_Trusted_Network_CA_2.pem
    Adding debian:Chambers_of_Commerce_Root_-_2008.pem
    Adding debian:Comodo_AAA_Services_root.pem
    Adding debian:Cybertrust_Global_Root.pem
    Adding debian:D-TRUST_Root_Class_3_CA_2_2009.pem
    Adding debian:D-TRUST_Root_Class_3_CA_2_EV_2009.pem
    Adding debian:DST_Root_CA_X3.pem
    Adding debian:Deutsche_Telekom_Root_CA_2.pem
    Adding debian:DigiCert_Assured_ID_Root_CA.pem
    Adding debian:DigiCert_Assured_ID_Root_G2.pem
    Adding debian:DigiCert_Assured_ID_Root_G3.pem
    Adding debian:DigiCert_Global_Root_CA.pem
    Adding debian:DigiCert_Global_Root_G2.pem
    Adding debian:DigiCert_Global_Root_G3.pem
    Adding debian:DigiCert_High_Assurance_EV_Root_CA.pem
    Adding debian:DigiCert_Trusted_Root_G4.pem
    Adding debian:E-Tugra_Certification_Authority.pem
    Adding debian:EC-ACC.pem
    Adding debian:EE_Certification_Centre_Root_CA.pem
    Adding debian:Entrust.net_Premium_2048_Secure_Server_CA.pem
    Adding debian:Entrust_Root_Certification_Authority.pem
    Adding debian:Entrust_Root_Certification_Authority_-_EC1.pem
    Adding debian:Entrust_Root_Certification_Authority_-_G2.pem
    Adding debian:GDCA_TrustAUTH_R5_ROOT.pem
    Adding debian:GeoTrust_Global_CA.pem
    Adding debian:GeoTrust_Primary_Certification_Authority.pem
    Adding debian:GeoTrust_Primary_Certification_Authority_-_G2.pem
    Adding debian:GeoTrust_Primary_Certification_Authority_-_G3.pem
    Adding debian:GeoTrust_Universal_CA.pem
    Adding debian:GeoTrust_Universal_CA_2.pem
    Adding debian:GlobalSign_ECC_Root_CA_-_R4.pem
    Adding debian:GlobalSign_ECC_Root_CA_-_R5.pem
    Adding debian:GlobalSign_Root_CA.pem
    Adding debian:GlobalSign_Root_CA_-_R2.pem
    Adding debian:GlobalSign_Root_CA_-_R3.pem
    Adding debian:GlobalSign_Root_CA_-_R6.pem
    Adding debian:Global_Chambersign_Root_-_2008.pem
    Adding debian:Go_Daddy_Class_2_CA.pem
    Adding debian:Go_Daddy_Root_Certificate_Authority_-_G2.pem
    Adding debian:Hellenic_Academic_and_Research_Institutions_ECC_RootCA_2015.pem
    Adding debian:Hellenic_Academic_and_Research_Institutions_RootCA_2011.pem
    Adding debian:Hellenic_Academic_and_Research_Institutions_RootCA_2015.pem
    Adding debian:Hongkong_Post_Root_CA_1.pem
    Adding debian:ISRG_Root_X1.pem
    Adding debian:IdenTrust_Commercial_Root_CA_1.pem
    Adding debian:IdenTrust_Public_Sector_Root_CA_1.pem
    Adding debian:Izenpe.com.pem
    Adding debian:LuxTrust_Global_Root_2.pem
    Adding debian:Microsec_e-Szigno_Root_CA_2009.pem
    Adding debian:NetLock_Arany_=Class_Gold=_Főtanúsítvány.pem
    Adding debian:Network_Solutions_Certificate_Authority.pem
    Adding debian:OISTE_WISeKey_Global_Root_GA_CA.pem
    Adding debian:OISTE_WISeKey_Global_Root_GB_CA.pem
    Adding debian:OISTE_WISeKey_Global_Root_GC_CA.pem
    Adding debian:QuoVadis_Root_CA.pem
    Adding debian:QuoVadis_Root_CA_1_G3.pem
    Adding debian:QuoVadis_Root_CA_2.pem
    Adding debian:QuoVadis_Root_CA_2_G3.pem
    Adding debian:QuoVadis_Root_CA_3.pem
    Adding debian:QuoVadis_Root_CA_3_G3.pem
    Adding debian:SSL.com_EV_Root_Certification_Authority_ECC.pem
    Adding debian:SSL.com_EV_Root_Certification_Authority_RSA_R2.pem
    Adding debian:SSL.com_Root_Certification_Authority_ECC.pem
    Adding debian:SSL.com_Root_Certification_Authority_RSA.pem
    Adding debian:SZAFIR_ROOT_CA2.pem
    Adding debian:SecureSign_RootCA11.pem
    Adding debian:SecureTrust_CA.pem
    Adding debian:Secure_Global_CA.pem
    Adding debian:Security_Communication_RootCA2.pem
    Adding debian:Security_Communication_Root_CA.pem
    Adding debian:Sonera_Class_2_Root_CA.pem
    Adding debian:Staat_der_Nederlanden_EV_Root_CA.pem
    Adding debian:Staat_der_Nederlanden_Root_CA_-_G2.pem
    Adding debian:Staat_der_Nederlanden_Root_CA_-_G3.pem
    Adding debian:Starfield_Class_2_CA.pem
    Adding debian:Starfield_Root_Certificate_Authority_-_G2.pem
    Adding debian:Starfield_Services_Root_Certificate_Authority_-_G2.pem
    Adding debian:SwissSign_Gold_CA_-_G2.pem
    Adding debian:SwissSign_Silver_CA_-_G2.pem
    Adding debian:T-TeleSec_GlobalRoot_Class_2.pem
    Adding debian:T-TeleSec_GlobalRoot_Class_3.pem
    Adding debian:TUBITAK_Kamu_SM_SSL_Kok_Sertifikasi_-_Surum_1.pem
    Adding debian:TWCA_Global_Root_CA.pem
    Adding debian:TWCA_Root_Certification_Authority.pem
    Adding debian:Taiwan_GRCA.pem
    Adding debian:TeliaSonera_Root_CA_v1.pem
    Adding debian:TrustCor_ECA-1.pem
    Adding debian:TrustCor_RootCert_CA-1.pem
    Adding debian:TrustCor_RootCert_CA-2.pem
    Adding debian:Trustis_FPS_Root_CA.pem
    Adding debian:USERTrust_ECC_Certification_Authority.pem
    Adding debian:USERTrust_RSA_Certification_Authority.pem
    Adding debian:VeriSign_Class_3_Public_Primary_Certification_Authority_-_G4.pem
    Adding debian:VeriSign_Class_3_Public_Primary_Certification_Authority_-_G5.pem
    Adding debian:VeriSign_Universal_Root_Certification_Authority.pem
    Adding debian:Verisign_Class_3_Public_Primary_Certification_Authority_-_G3.pem
    Adding debian:XRamp_Global_CA_Root.pem
    Adding debian:certSIGN_ROOT_CA.pem
    Adding debian:ePKI_Root_Certification_Authority.pem
    Adding debian:thawte_Primary_Root_CA.pem
    Adding debian:thawte_Primary_Root_CA_-_G2.pem
    Adding debian:thawte_Primary_Root_CA_-_G3.pem
    done.
    Setting up adwaita-icon-theme (3.36.1-2ubuntu0.20.04.2) ...
    update-alternatives: using /usr/share/icons/Adwaita/cursor.theme to provide 
    /usr/share/icons/default/index.theme (x-cursor-theme)
    Setting up libgtk2.0-0:amd64 (2.24.32-4ubuntu4)
    Setting up humanity-icon-theme (0.6.15)
    Setting up libgail18:amd64 (2.24.32-4ubuntu4) ...
    Setting up libgtk2.0-bin (2.24.32-4ubuntu4)
    Setting up libgail-common:amd64 (2.24.32-4ubuntu4)
    Setting up ubuntu-mono (19.04-0ubuntu3)
    Processing triggers for man-db (2.9.1-1)
    Processing triggers for ca-certificates (20190110ubuntu1) ...
    Updating certificates in /etc/ssl/certs...
    0 added, 0 removed; done.
    Running hooks in /etc/ca-certificates/update.d...
    
    done.
    done.
    Setting up openjdk-8-jre-headless:amd64 (8u265-b01-0ubuntu2~20.04) ...
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmid to provide
     /usr/bin/rmid (rmid) in auto 
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java to provide
     /usr/bin/java (java) in auto mode
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/keytool to provide 
    /usr/bin/keytool (keytool) in auto mode
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/jjs to provide 
    /usr/bin/jjs (jjs) in auto mode
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/pack200 to provide 
    /usr/bin/pack200 (pack200) in auto mode
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/rmiregistry to provide 
    /usr/bin/rmiregistry (rmiregistry) in
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/unpack200 to provide 
    /usr/bin/unpack200 (unpack200) in auto
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/orbd to provide 
    /usr/bin/orbd (orbd) in auto mode
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/servertool to provide 
    /usr/bin/servertool (servertool) in au
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/tnameserv to provide 
    /usr/bin/tnameserv (tnameserv) in auto
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/jexec to provide 
    /usr/bin/jexec (jexec) in auto mode
    Processing triggers for mime-support (3.64ubuntu1) ...
    Processing triggers for libc-bin (2.31-0ubuntu9) ...
    Setting up openjdk-8-jre:amd64 (8u265-b01-0ubuntu2~20.04) ...
    update-alternatives: using /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/policytool to provide 
    /usr/bin/policytool (policytool) in au
    Processing triggers for libgdk-pixbuf2.0-0:amd64 (2.40.0+dfsg-3) ...
    Processing triggers for libc-bin (2.31-0ubuntu9)
  8. Now try command java -version to see if Java is being installed,
     $ java -version
    openjdk version "1.8.0_265"
    OpenJDK Runtime Environment (build 1.8.0_265-8u265-b01-0ubuntu2~20.04-b01)
    OpenJDK 64-Bit Server VM (build 25.265-b01, mixed mode)