update-alternatives: "alternative path doesn't exist" issue while updating JDK7

It's my epic fault! :)

I mixed up the arguments of update-alternatives. The right command line must be:

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk/bin/java 1

Since you are updating from a previous Java version, which you have removed manually, you would have to execute the following command twice. You get an error message the first time and it works when you execute it the second time.

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk/bin/java" 1

Source: Easy Linux Project