1

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.

Thanks.

Byte Commander
  • 107,489
eric
  • 133

1 Answers1

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.

Byte Commander
  • 107,489
fosslinux
  • 3,831
  • 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 '18 at 22:35
  • Correct. Unless you choose to go the PPA method... – fosslinux Mar 20 '18 at 22:39