You can install several different java versions on to your system. You can set the default using the update-alternatives command.
Here is a solution to a similiar problem, which is maybe of use for you:
https://askubuntu.com/questions/121654/how-to-set-default-java-version