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

October 31, 2019 | By the+gnu+linux+evangelist.

Setting Up

  1. 4. Setting Up Java

    Next to Set Up 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 Download and Install Oracle JDK on Ubuntu 18.04 Bionic Easy Guide - JDK Configuration

  2. 5. Setting Up Env

    (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

    Possibly 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
  3. Finally, Test New Java JDK 11 Installation.

    java -version

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

QuickChic Theme • Powered by WordPress