How to Install Oracle JDK 11 on Ubuntu 18.04 Bionic LTS Easy Guide

May 2, 2018 | By thelinuxevangelist | Filed in: Tutorial.

Install Oracle JDK 11 Ubuntu 18.04 Bionic

You are Welcome! The Tutorial Shows You Step-by-Step How-to Install Oracle JDK 11 on Ubuntu 18.04 Bionic LTS 32/64-bit GNU/Linux.

And to SetUp Oracle JDK 11 on Ubuntu 18.04 you will need to Use the update-alternatives Tool to Update your System Java to 1.11.

Especially Relevant: this is an Early Preview Dev Snapshot because the Oracle JDK 11 Release it’s scheduled for September 2018.

Finally, about the New Java 11 Features:

  • Local-Variable Syntax for Lambda Parameters
  • Epsilon: An Arbitrarily Low-Overhead Garbage Collector
  • Dynamic Class-File Constants
  • Remove the Java EE and CORBA Modules
How to Install Oracle JDK 11 on Ubuntu 18.04 Bionic Easy Guide - Featured
  1. Open a Shell Terminal emulator window
    Ctrl+Alt+t on Desktop
    (Press “Enter” to Execute Commands)

    How to Install Oracle JDK 11 on Ubuntu 18.04 Bionic Easy Guide - Open Terminal
  2. Download Oracle Java SE JDK 11 for Linux:

    Oracle JDK 11 Linux tar.gz
  3. Double-Click on the tar.gz Archive and Extract into /tmp
    Or from Shell:

    tar xvzf ~/Downloads/jdk-11*.tar.gz -C /tmp/

    How to Install Oracle JDK 11 on Ubuntu 18.04 Bionic Easy Guide - Java JDK 11 tar.gz Extraction Path

  4. Relocate Java JDK 11

    sudo su

    If Got “User is Not in Sudoers file” then Look: Solution
    Make a jvm Directory if Not already there with

    if [ ! -d "/usr/lib/jvm" ]; then mkdir /usr/lib/jvm; fi

    Set the root superUser as howner:

    chown -R root:root /tmp/jdk-11

    Reiterate the Execution Permission over the Java binaries:

    chmod -R +x /tmp/jdk-11/bin

    Finally Shift the Java contents with:

    mv /tmp/jdk-11 /usr/lib/jvm/
  5. Installing Oracle Java JDK 11
    You can directly Copy & Paste the Commands into Terminal…

    update-alternatives --install \
    /usr/bin/java java /usr/lib/jvm/jdk-11/bin/java 1165
    update-alternatives --install \
    /usr/bin/javac javac /usr/lib/jvm/jdk-11/bin/javac 1165
    update-alternatives --install \
    /usr/bin/jar jar /usr/lib/jvm/jdk-11/bin/jar 1165
    update-alternatives --install \
    /usr/bin/javaws javaws /usr/lib/jvm/jdk-11/bin/javaws 1165

    Checking or Setting the System Java Version in Use with

    update-alternatives --config java

    And for the Java Compiler instead:

    sudo update-alternatives --config javac

    To Switch of Java Version Just Enter the Selection Number on First Column. :)

    How to Install Oracle JDK 11 on Ubuntu 18.04 Bionic Easy Guide - JDK Configuration

  6. (Optional) Setting JAVA_HOME User Environment Variable

    su [myUserName]

    Or simply:

    exit

    And Edit the Bash environment Configuration file

    nano $HOME/.bashrc

    Append:

    export JAVA_HOME=/usr/lib/jvm/jdk-11

    Eventually to Check the JDK 11 exact PATH use in another window:

    ls /usr/lib/jvm/

    Ctr+x to Save & Exit from nano Editor :)
    Next to Load the New Bash Environment:

    bash
  7. Finally Test New Java JDK 11 Installation

    java -version
  8. Java IDEs Installation on Ubuntu

    Eclipse IDE for Java Development Install on Ubuntu: Installing Eclipse IDE for Java Dev on Ubuntu.

    Netbeans IDE for Java Development Install on Ubuntu: Installing NetBeans IDE for Java Dev on Ubuntu.

    IntelliJ IDEA 2018 for Java Development Install on Ubuntu: Installing IntelliJ IDEA for Java Dev on Ubuntu.

    Now Thanks to Oracle-Sun Corporation You are Able to Successfully Start Up with Java 11 Development.

    Welcome to Java 11 New Dev Env! ;)


Tags: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,