All the questions on here I've found are how to install JDK. I have JDK already, but Android Studio says it's outdated. I'm asking where I can update JDK.

"which java" in terminal gives /usr/lib/jvm/java-8-oracle/jre/bin/java, but installing the tar file there does not update the JDK. Neither does installing in /usr/lib/jvm/java-8-oracle.


  • You update by (removing the older and) installing the newer version.
    – Byte Commander
    Mar 20, 2018 at 21:12
  • Did you install using apt or from a website online?
    – fosslinux
    Mar 20, 2018 at 21:43
  • @Byte I have a folder named JRE in usr/lib/jvm/java-8-oracle. Do I just right click delete the JRE folder? Thanks
    – eric
    Mar 20, 2018 at 21:55
  • @ubashu I went to Oracle's site, downloaded the tar then ran sudo tar xvzf on it. Thanks
    – eric
    Mar 20, 2018 at 21:56

1 Answer 1


Firstly, you may find it easier to use webupd8's PPA. You can find more information at the launchpad page for the PPA. https://launchpad.net/~webupd8team/+archive/ubuntu/java. To add this PPA, run:

sudo rm -r /usr/lib/jvm/java-8-oracle  # to remove the current installation
sudo apt-get install python-software-properties  # to install the extra commands to add the apt repository
sudo add-apt-repository ppa:webupd8team/java  # to add the PPA (accept the prompts)
sudo apt-get update  # to get the repository info from the PPA
sudo apt-get install oracle-java8-installer  # to install the oracle java (version 8, what you previously had installed)
sudo apt-get install oracle-java8-set-default  # to set the newly installed java as default

In order to update, you can simply use your normal update procedure.

If you choose to continue with the downloading from Oracle method, you need to complete the following steps:

  1. Remove the old installation.
  2. Download the tarball and install it.

To remove the old installation, you can simply run in a terminal

sudo rm -r /usr/lib/jvm/java-8-oracle

And then use the same installation steps as you used previously. If you need help with this, please see this question.

  • Oh, I see. So Java 8 = "JDK 8u162"? And to update (from 8u77 to 8u162 in my case), I just have to delete Java 8 altogether and then reinstall it altogether?
    – eric
    Mar 20, 2018 at 22:35
  • Correct. Unless you choose to go the PPA method...
    – fosslinux
    Mar 20, 2018 at 22:39

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .