I recently installed Ubuntu 16.04 on my computer after that I installed Java and now I want to update the current version of java.

Current Version is jdk-8u11 and i want to upgrade it to jdk-8u112.

Can someone please tell me that how to upgrade it?

Please consider that I am new to Ubuntu.

  • Are you using the java from Ubuntu repo ? – George Udosen Dec 23 '16 at 8:19
  • What is the output of this command: java -version – Ryko Dec 23 '16 at 10:25

I assume you install java from ppa:webupd8team/java. But actually last version of java is still jdk-8u111. If you want use jdk-8u112 version, you can install it by downloading their binary and creating symlink.

  • Remove/uninstall jdk-8u111
  • Download 8u112 binary from here
  • Uncompress, move to /usr/java

    sudo tar xvzf jdk-8u112-linux-i586.tar.gz -C /usr/java

Now to set your JAVA_HOME environment variable:

sudo update-alternatives --install /usr/bin/java java ${JAVA_HOME%*/}/bin/java 20000
sudo update-alternatives --install /usr/bin/javac javac ${JAVA_HOME%*/}/bin/javac 20000

Make sure the Oracle's java is set as default java by:

update-alternatives --config java

Confirm your recent java version

java -version

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.