First install JDK 6 sudo apt-Get install sun-java6-jdk and then set the default Java program sudo Update-alternatives-confi

Source: Internet
Author: User
Install JDK 6 first
Sudo apt-Get install sun-java6-jdk

 

Then you need to set the default JavaProgram
Sudo Update-alternatives -- config Java
Enter the corresponding options as prompted, and set them to JDK 6.

The following settings
Sudo Vim/etc/environment

Add the following two lines:
Classpath =/usr/lib/JVM/Java-6-sun/lib
Java_home =/usr/lib/JVM/Java-6-sun
If classpath and java_home are already set, change them to the above format and press ZZ to save and exit.

Next install eclipse
Sudo apt-Get install eclipse

Note that eclipse does not care about the update-alternative

Therefore, you should modify the eclipse configuration. First, set the SUN-JDK-6 to the system default:

Sudo Update-Java-alternatives-s Java-6-sun

Then edit the JVM configuration file:
Sudo Vim/etc/JVM

Add
/Usr/lib/JVM/Java-6-sun
(If not, create it by yourself)

Sudo Vim/etc/Eclipse/java_home

Also add at the top of the file
/Usr/lib/JVM/Java-6-sun

Start eclipse, select help-> about eclipse SDK, and select configuration details. You can see that jdk6 settings have taken effect.

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.