• Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us
TecAdmin
Menu
  • Home
  • Ubuntu 18.04
    • Whats New?
    • Upgrade Ubuntu
    • Install Java
    • Install Node.js
    • Install Docker
    • Install Git
    • Install LAMP Stack
  • Tutorials
    • AWS
    • Shell Scripting
    • Docker
    • Git
    • MongoDB
  • Funny Tools
  • FeedBack
  • Submit Article
  • About Us

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

Written by Rahul, Updated on 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!

Share it!
Share on Facebook
Share on Twitter
Share on LinkedIn
Share on Reddit
Share on Tumblr
Share on Whatsapp
Rahul
Rahul
Connect on Facebook Connect on Twitter

I, Rahul Kumar am the founder and chief editor of TecAdmin.net. I am a Red Hat Certified Engineer (RHCE) and working as an IT professional since 2009..

7 Comments

  1. Avatar Maxim Reply
    August 6, 2020 at 12:37 pm

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

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

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

  3. Avatar Frank Reply
    July 15, 2019 at 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)

  4. Avatar Aegwinn Reply
    February 8, 2019 at 8:41 am

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

    🙂

  5. Avatar Afa Mobius Reply
    December 24, 2018 at 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

  6. Avatar Trubadur Reply
    October 13, 2018 at 8:13 pm

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

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

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

Leave a Reply Cancel reply

Popular Posts

  • How To Install Python 3.9 on Ubuntu 20.04 5
  • How To Install Python 3.9 on Ubuntu 18.04 0
  • How to Use AppImage on Linux (Beginner Guide) 2
  • How to Install Python 3.9 on CentOS/RHEL 7 & Fedora 32/31 0
  • How To Install VNC Server on Ubuntu 20.04 1
© 2013-2020 Tecadmin.net. All Rights Reserved | Terms  | Privacy Policy