Visit the following link:
1) Download the version of java from the Self Extracting file link for Linux.
2) Click on the instructions link beside it and follow the instructions.
The instructions given on the above website work, I use those instructions all the time when I am setting up JRE for people on their Linux computers.
I am aslo using Ubuntu and it all works fine, so don't get disheartened. It is not the fault of Ubuntu, you are just going about the Java thing the wrong way.