Ubuntu enables to run more than one Java VM. Sometimes a dynamic change of Java VMs are needed. That's possible with the following command:
Rafael
sudo update-alternatives --config javaRegards
Rafael

Due to AppArmor (standard config) it is not possible to run your own Java version with Ubunutu 9.04+. So you have to create your own AppArmor profile or uninstall this module.
(see also http://help.ubuntu.com/community/AppArmor)