Install and configure JDK 6 and eclipse in Ubuntu

Source: Internet
Author: User

First install JDK 6, open the terminal, and enter the following command
Sudo apt-Get install sun-java6-jdk

Then you need to set the default Java program
Sudo Update-alternatives -- config Java

Enter the corresponding options as prompted, and set them to JDK 6.

The following settings
Sudo VI/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 VI/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.

 

The above method is personally tested and can be used

Related Article

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.