If you have installed multiple Java-Versions and you want to configure your system to use one of them as the default, there is a really simple command to achieve that goal:
1) Check Java version
$ java -version
- The output should look similar to something like this:
java version "1.7.0_147-icedtea" OpenJDK Runtime Environment (IcedTea7 2.0) (7~b147-2.0-0ubuntu0.11.10.1) OpenJDK 64-Bit Server VM (build 21.0-b17, mixed mode)
As you can see my systems default is set to java-7-openjdk (1.7.0_147-icedtea).