Facebook Twitter Instagram
    TecAdmin
    • Home
    • FeedBack
    • Submit Article
    • About Us
    Facebook Twitter Instagram
    TecAdmin
    You are at:Home»Programming»JAVA»How to Install Oracle Java 11 on Debian 9 (Stretch)

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

    By RahulFebruary 11, 20192 Mins Read

    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.

    Advertisement

    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

    Related Posts

    What is the Access Modifiers in Java

    What are the Access Modifiers in Java

    Installing Java on Ubuntu 22.04

    How to Install JAVA on Ubuntu 22.04

    How to Get Value from Key in Java HashMap

    Java HashMap – How to Get Value from Key

    View 7 Comments

    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

    Advertisement
    Recent Posts
    • How to List Manually Installed Packages in Ubuntu & Debian
    • 10 Bash Tricks Every Developer Should Know
    • How to Validate Email Address in JavaScript
    • Firewalld: Common Firewall Rules and Commands
    • 12 Apk Commands in Alpine Linux Package Management
    Facebook Twitter Instagram Pinterest
    © 2023 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy

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