Facebook Twitter Instagram
    TecAdmin
    • Home
    • Ubuntu 20.04
      • Upgrade Ubuntu
      • Install Java
      • Install Node.js
      • Install Docker
      • Install LAMP Stack
    • Tutorials
      • AWS
      • Shell Scripting
      • Docker
      • Git
      • MongoDB
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    Home»Programming»JAVA»How to Install Oracle Java 11 on Debian 9 (Stretch)

    How to Install Oracle Java 11 on Debian 9 (Stretch)

    RahulBy RahulOctober 1, 20182 Mins ReadUpdated:February 11, 2019

    Java is a popular programming language for system software development and web application. You need to install the Java Development Kit (JDK) and Java Runtime Environment (JRE) for the setup of the Java development environment. JDK compiled the source java file and make a java class file. JRE is used to run that intermediate class file. This tutorial will guide you to install Oracle Java 11 LTS version on Debian 9 Stretch Linux system.

    Step 1 – Prerequsities

    Before beginning the installation login to shell as the sudo user and install some required packages on your Debian system.

    sudo apt install dirmngr
    sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EA8CACC073C3DB2A
    

    Now, add the following PPA to your Debian system. This PPA contains a package oracle-java11-installer having the Java installation script.

    echo "deb http://ppa.launchpad.net/linuxuprising/java/ubuntu bionic main" | sudo tee /etc/apt/sources.list.d/linuxuprising-java.list
    

    Step 2 – Install Java 11 on Debian 9

    Then install Java 11 using the script provided in these packages. This script downloads the Java archive from the official site and configures on your system

    sudo apt update
    sudo apt install oracle-java11-installer
    

    Also, install the following package to configure Java 11 as default Java version on your Debian 9 system.

    sudo apt install oracle-java11-set-default
    

    Step 3 – Verify Java Version

    Check the installed Java version on your system using the following command.

    java -version
    
    java version "11.0.2" 2018-10-16 LTS
    Java(TM) SE Runtime Environment 18.9 (build 11.0.2+7-LTS)
    Java HotSpot(TM) 64-Bit Server VM 18.9 (build 11.0.2+7-LTS, mixed mode)
    

    You have successfully installed Java 11.0.1 on Debian 9 Stretch Linux system.

    Happy coding!

    Debian 9 Java 11 Java 11 LTS Stretch
    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email WhatsApp
    Previous ArticleHow to Install Java 11 on CentOS 7/6
    Next Article How to Install FFmpeg on Fedora 34/33/32

    Related Posts

    How to Install JAVA on Ubuntu 22.04

    Updated:May 16, 20224 Mins Read

    Java HashMap – How to Get Value from Key

    Updated:April 6, 20222 Mins Read

    Java HashMap – How to Get Key from Value

    Updated:April 6, 20222 Mins Read

    5 Methods to Print an Array in Java

    Updated:April 21, 20222 Mins Read

    How To Install Java on Debian 11

    4 Mins Read

    How to Install Python 3.9 on Debian 9

    Updated:April 7, 20213 Mins Read

    7 Comments

    1. Maxim on August 6, 2020 12:37 pm

      Thanks you! I successfully installed Java 14 on my machine!

      Reply
    2. G on July 24, 2020 3:57 pm

      Indeed, better install java11 from “stretch-backports” repository.

      Reply
    3. Frank on July 15, 2019 11:25 am

      Not work out of the box. Need manual downloading!

      # apt install oracle-java11-installer-local
      Reading package lists… Done
      Building dependency tree
      Reading state information… Done
      The following additional packages will be installed:
      binutils java-common
      …
      Fetched 3,818 kB in 0s (6,488 kB/s)
      Preconfiguring packages …
      Selecting previously unselected package binutils.
      (Reading database … 33861 files and directories currently installed.)
      Preparing to unpack …/binutils_2.28-5_amd64.deb …
      Unpacking binutils (2.28-5) …
      Selecting previously unselected package java-common.
      Preparing to unpack …/java-common_0.58+deb9u1_all.deb …
      Unpacking java-common (0.58+deb9u1) …
      Setting up binutils (2.28-5) …
      Selecting previously unselected package oracle-java11-installer-local.
      (Reading database … 34187 files and directories currently installed.)
      Preparing to unpack …/oracle-java11-installer-local_11.0.3-1~linuxuprising2_amd64.deb …
      Unpacking oracle-java11-installer-local (11.0.3-1~linuxuprising2) …
      Processing triggers for mime-support (3.60) …
      Setting up java-common (0.58+deb9u1) …
      Processing triggers for libc-bin (2.24-11+deb9u4) …
      Processing triggers for man-db (2.7.6.1-2) …
      Setting up oracle-java11-installer-local (11.0.3-1~linuxuprising2) …
      Before installing this package,
      please download the Oracle JDK 11 .tar.gz file
      with the same version as this package,
      and place it in /var/cache/oracle-jdk11-installer-local,

      E.g.:
      sudo mkdir -p /var/cache/oracle-jdk11-installer-local
      sudo cp jdk-11.0.3_linux-x64_bin.tar.gz /var/cache/oracle-jdk11-installer-local/
      sha256sum mismatch jdk-11.0.3_linux-x64_bin.tar.gz
      Oracle JDK 11 is NOT installed.
      dpkg: error processing package oracle-java11-installer-local (–configure):
      subprocess installed post-installation script returned error exit status 1
      Errors were encountered while processing:
      oracle-java11-installer-local
      E: Sub-process /usr/bin/dpkg returned an error code (1)

      Reply
    4. Aegwinn on February 8, 2019 8:41 am

      hey, thanks for the guide. you made a spellerror, the package is called dirmngr. you missed the “n”

      🙂

      Reply
    5. Afa Mobius on December 24, 2018 11:48 pm

      thanks man , it bothered me installing it in other ways I spent like 2 hours testing all tutorials , but this one works , so thanks again

      Reply
    6. Trubadur on October 13, 2018 8:13 pm

      “You have successfully installed Java 11 on Debian 8 Strech Linux system.”
      ?

      Reply
      • Rahul K. on October 15, 2018 7:43 am

        Sorry, This article was tested on Debian 9. I have corrected the typo.

        Reply

    Leave A Reply Cancel Reply

    Recent Posts
    • How to Install JAVA on Ubuntu 22.04
    • Switching Display Manager in Ubuntu – GDM, LightDM & SDDM
    • Changing the Login Screen Background in Ubuntu 22.04 & 20.04
    • How To Install PHP (8.1, 7.4 or 5.6) on Ubuntu 22.04
    • (Resolved) Please install all available updates for your release before upgrading
    Facebook Twitter Instagram Pinterest
    © 2022 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

    Type above and press Enter to search. Press Esc to cancel.