Replacing OpenJDK with Oracle JDK

Since I can’t use OpenJDK for most applications (see last post), I was looking for a way to easily replace it with the original JDK. Thankfully I found a good howto. The short version:

# Download Java from Oracle * and extract the contents of the tar.gz archive to "java-7-oracle"
sudo mv java-7-oracle/ /usr/lib/jvm/
sudo add-apt-repository ppa:nilarimogard/webupd8
sudo apt-get update
sudo apt-get install update-java
sudo update-java

This should work for Ubuntu 11.10, 11.04, 10.10 and 10.04.