Now ,ubuntu 11.10 is becoming harder and harder to install jdk ,why? Some sources dose not work,so we need to find out the new source.
Follow orders can be used to install jdk. At least ,before 3/8/2012 ,it works.
Good luck.
sudo add-apt-repository ppa:ferramroberto/java
sudo apt-get updatesudo apt-get install sun-java6-jdk