1. If you change root's .bash_profile, it will only apply to root. If you want to make system-wide changes, then edit /etc/profile (as root).
2. Open ~/.bash_profile in your favourite text editor. I will assume that you installed Java to /usr/java (subsitute for wherever you actually installed it) Change the line PATH=... to look like:
Then run the command
to apply the changes to your current shell.
Run "java --version" to check that it is installed correctly.
I hope this helps