Installing Java JDK on ubuntu 10.10 or 11.04

Posted by {"display_name"=>"greg", "login"=>"greg", "email"=>"greg@udon.org", "url"=>""} on May 04, 2011 · 1 min read

Installing the Java JDK from the command line is so much easier than Oracle's web package based install.

For ubuntu 10.10, here are the commands:

$ sudo add-apt-repository ppa:sun-java-community-team/sun-java6
$ sudo apt-get update
$ sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk

With ubuntu 11.04 I had to execute these commands:

$ sudo add-apt-repository ppa:ferramroberto/java
$ sudo apt-get update
$ sudo apt-get install sun-java6-jre sun-java6-bin sun-java6-jdk

Set the JAVA_HOME environment variables in your /etc/profile or .bashrc file.

JAVA_HOME=/usr/lib/jvm/java-6-sun
export JAVA_HOME