The previous manual download package and installation of Java eventually led to Android compilation failure. After a long time, I did not find the cause. Today I started to use the source to install Java and wrote down the experience or related links for backup.
Install sun-java6-jdk
When installing Sun JDK in Ubuntu 10.04, you will be prompted to not find the reported sun-java6-jdk, but the use of the tab key can clearly prompt sun-java6-jdk, very strange. Apt-Get will prompt the following information:
Package sun-java6-jdk is not available, but is referred to by another package. This may mean that the package is missing, has been obsoleted, oris only available from another sourcee: Package sun-java6-jdk has no installation candidate
You can solve this problem by using the following methods:
Sudo add-Apt-repository "Deb http://archive.canonical.com/lucid partner" sudo apt-Get updatesudo apt-Get install sun-java6-jdk
After the installation is complete, configure the default JRE:
Sudo Update-alternatives -- config Java
Select 2.
Install sun-java5-jdk
The sun-java5-jdk is no longer available in the source of 10.04, you can use the source of a previous version:
Sudo add-Apt-repository "Deb http://us.archive.ubuntu.com/ubuntu/ jaunty Multiverse" sudo add-Apt-repository "Deb http://us.archive.ubuntu.com/ubuntu/ jaunty-Updates Multiverse" sudo apt-Get updatesudo apt-Get install sun-java5-jdk
To use JDK 1.5, you can configure it as follows:
Sudo Update-alternatives -- config Java
Select a number.
If JDK 1.6 is used by default, run the following command to uninstall JDK 1.6:
Sudo apt-Get remove sun-java6-jdk
From: http://my.opera.com/lexusine/blog/install-sun-jdk-on-ubuntu-10-04
Note:
The Java configuration page appears during the installation process. I didn't know how to operate it at first. Later, I found that I needed to use the tab key to select OK to continue the installation. (Previously, the installation failed here. I quit directly and suddenly killed me !)
Running to the back of the display running ing sun-java6-jre, it feels like interrupted, OK key can not be clicked, then you need to click the tab key to select the OK key, and then continue. Next, you know!