59

Recently, I've installed JDK 7 from the Oracle site, using these instructions.

Now, I'm wondering what is the correct method to update it (or, better, to keep up-to-date automatically)? For instance, there were some security issues fixed few days ago.

BuZZ-dEE
  • 14,533
pilat
  • 693

1 Answers1

90

Now, you can use the Linux Uprising Java PPA, so you get updates automatically through the package manager. If you need the latest Oracle Java 12, you install it:

sudo add-apt-repository ppa:linuxuprising/java
sudo apt-get update
sudo apt-get install oracle-java12-installer
sudo update-alternatives --config java

Old solution - DISCONTINUED- does not work anymore

You can use the WebUpd8 Java PPA, so you get updates automatically through the package manager. If you need the latest Oracle Java 8, you install it:

sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo update-java-alternatives -s java-8-oracle

If you need the latest Oracle Java 6 (Outdated version), you install it too:

sudo apt-get install oracle-java6-installer

If you need the latest Oracle Java 7 (Outdated version), you install it too:

sudo apt-get install oracle-java7-installer

If you want test Oracle Java 9 early access builds, you can install it too:

sudo apt-get install oracle-java9-installer

To switch between different Java versions, you could use the following terminal command:

sudo update-alternatives --config java

Source:

BuZZ-dEE
  • 14,533