How do I update Oracle Java (JDK and JRE)
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.
possible duplicate of How can I install Sun/Oracle's proprietary Java 6/7 JRE or JDK?
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
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
- Web Upd8: Install Oracle Java 7 in Ubuntu via PPA Repository
- Web Upd8: Oracle Releases Critical Security Update For Java 7 (7U13) And Java 6 (6U39), PPA Updated
- Web Upd8: Install Oracle Java 8 In Ubuntu Via PPA [JDK8]
- Web Upd8: Oracle Java 8 (Stable) Released, Install it In Ubuntu
- Web Upd8: Install Oracle Java 9 In Ubuntu, Linux Mint Or Debian Via PPA Repository [JDK9]
I can't downvote rightnow but I criticize this. You told an entirely new way of installation instead of answering upon what OP asked for. May be didn't choose `webupd8` installation because of some valid reasons. Like in my case I didn't go for it as it didn't provided just JRE & I didn't required the entire JDK package. I think you must provide an answer to the OP's situation besides suggesting this alternate way.
Reread the OP, user01: "Recently, I've installed JDK 7 from the Oracle site," The question is therefore: "How can I keep my JDK installations up to date automatically?"
This is very good answer, indeed. If there were another one, explaining how to do it without repositories, I'd probably upvoted it too.
Is there a way to run `update-alternatives` when you don't have interactive access? Like during ansible provisioning?