Install Java in Ubuntu 11.10 (2)

Source: Internet
Author: User

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!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.