Do you need to use "sh" when installing Java on Ubuntu? Whenever I have installed Java on Ubuntu, I have followed the instructions here, using the "self-extracting" version (not RPM, which doesn't work well on Ubuntu). It has always worked for me. Remember you have to update your PATH which is probably easiest done by editing the .bashrc file in your home folder to add a line like
assuming you put your installation in /usr/java. If that doesn't work, checking the installation size and maybe a new download may be necessary.
Note that the preferred way to install software on Ubuntu (and on other Linux distributions) is by using the package management system specific to your distro, instead of installing software manually. Sun Java 6 is available in the Ubuntu software repository, and you can install the JDK by installing the package sun-java6-jdk by using Synaptic, or by entering the following command:
sudo apt-get install sun-java6-jdk
After installing it that way, to make sure that Sun Java 6 is the default version of Java that's used on your system, use Dawn's command: