Simple script to install Oracle's JDK on Ubuntu and integrate it with the update-java-alternatives
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.

Steps to install Oracle JDK on Ubuntu:

Download the tar.gz from here

Download the script


Run the script as root pointing it to the downloaded tar.gz archive

$ sudo bash install-jdk ~/Downloads/jdk-7u4-linux-x64.tar.gz

The script prompts you for what to do next

JVM: /usr/lib/jvm/jdk1.7.0_04/
alias: jdk1.7.0_04

+++ Currently available javas:
java-6-sun 63 /usr/lib/jvm/java-6-sun
java-7-oracle 100 /usr/lib/jvm/java-7-oracle
jdk1.7.0_04 168 /usr/lib/jvm/jdk1.7.0_04

+++ Select the newly installed java using:
sudo update-java-alternatives -s jdk1.7.0_04

So let's update the system-wide java

sudo update-java-alternatives -s jdk1.7.0_04

Verify the new version is installed

$ java -version
java version "1.7.0_04"
Java(TM) SE Runtime Environment (build 1.7.0_04-b20)
Java HotSpot(TM) 64-Bit Server VM (build 23.0-b21, mixed mode)