Oracle Java in Ubuntu

So you know that OpenJDK is preferred but want the latest Oracle version of Java and trust webupd8team to do it for you automatically? This was tested 30 Dec 2013 using Ubuntu 13.10 (Saucy Salamander) and Java 1.7.0_45-b18 but it works on many Debian derivatives. Give it a try:

# Add the repository ppa:webupd8team/java (recommended) or ppa:eugenesan/java
$ sudo add-apt-repository ppa:webupd8team/java

# Update the source list
$ sudo apt-get update

# Install Java
$ sudo apt-get install oracle-java7-installer

# Check the version
$ java -version
java version "1.7.0_45"
Java(TM) SE Runtime Environment (build 1.7.0_45-b18)
Java HotSpot(TM) 64-Bit Server VM (build 24.45-b08, mixed mode)
Should you need to purge old versions:
 sudo apt-get purge oracle-java7-installer*
 sudo apt-get install ppa-purge
 sudo ppa-purge ppa:eugenesan/java
 sudo ppa-purge ppa:webupd8team/java
 sudo apt-get clean
 sudo apt-get update

No comments: