If you install Java on Ubuntu, you do not have to add it to your PATH yourself.
First install Java from the Ubuntu repository:
sudo apt-get install sun-java6-jre
There are several other packages: sun-java6-jdk for the JDK, sun-java6-plugin for the plug-in, etc.
Use an alternative Ubuntu mechanism to select Sun Java 6 as the standard version of Java that you want to use:
sudo update-alternatives
, , Java ( Java).
: https://help.ubuntu.com/community/Java