Ubuntu installation of JDK (non-OPENJDK) solves common problem of not finding source __jdk

Source: Internet
Author: User
JDK installation command:


sudo apt-get install SUN-JAVA6-JDK

sudo apt-get install sun-java6-jre sun-java6-jdk sun-java6-plugin

*************************************************************************************

Problems that may arise:

1 Package sun-java6-jdk is not available, but are referred to by another Package.

2 E:package SUN-JAVA6-JDK has no installation candidate ************************************************************* ************************
Solution when unable to install:
SETP 1.
Add Source:
Deb Http://archive.canonical.com/lucid Partner

Deb-src http://archive.canonical.com/lucid partner or
sudo add-apt-repository "Deb http://archive.canonical.com /lucid partner "

Step 2.
Add Source:
Deb Http://us.archive.ubuntu.com/ubuntu/hardy multiverse

************************************

Set JDK environment variable

sudo gedit/etc/profile
Add code:
#s ET Java Environment
Export java_home=/opt/jdk1.6.0_20
Export jre_home= $JAVA _home/jre
Export classpath= $CLA Sspath: $JAVA _home/lib: $JRE _home/lib
Export path= $PATH: $JAVA _home/bin: $JRE _home/bin
Save exit.

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.