Question: Here is the output to some inspection that I did:

```
$ java -version

java version "1.7.0_21"
Java(TM) SE Runtime Environment (build 1.7.0_21-b11)
Java HotSpot(TM) 64-Bit Server VM (build 23.21-b01, mixed mode)

```

and

```
$ update-java-alternatives -l

java-1.6.0-openjdk-amd64 1061 /usr/lib/jvm/java-1.6.0-openjdk-amd64

```

and 

```
$ ls /usr/lib/jvm/

default-java  java-1.5.0-gcj-4.6  java-1.6.0-openjdk  java-1.6.0-openjdk-amd64  java-6-openjdk  java-6-openjdk-amd64  java-6-openjdk-common  java-7-openjdk-amd64

```

With that in mind, how do I go about changing the default to 1.6 so that when I execute java -version, it tells me 1.6?

Thanks!

Answer: 
I am on Fedora but I hope that alternatives works the same way on Ubuntu. You need to run `update-alternatives --config java` (on Fedora just `alternatives --config java`) to see what options you have. Then type the number of the JDK you want to use and press enter. And that's it:-)
Set default java:

```none
mv /usr/bin/java /usr/bin/java_1.6

ln -s /usr/java/jdk1.7.0_55/bin/java /usr/bin/

```