Configure the eclipse development environment in Ubuntu

Source: Internet
Author: User

I believe most people will configure Eclipse in Windows. So, what about replacing the system with Ubuntu?

I found that the default Jdk in Ubuntu is Openjdk. I don't know if it was automatically installed with apt-get. As a result, the development in Eclipse is greatly unsuitable because the standard Jdk is used in the past.

1)

Query java version terminal input: java-version

So how to configure your Ubuntu and Jdk?

First, www.sun.com, download the Linux JDK, I download this JDK: jdk-7u3-linux-i586.tar.gz.

Decompress tar zxvf jdk-7u3-linux-i586.tar.gz

Modify system environment variables

 
 
  1. Sudo vi/etc/environment
  2.  
  3. PATH = "/home /... /Download/jdk1.7.0 _ 03/bin"
  4.  
  5. CLASSPATH = "/home /... /Download/jdk1.7.0 _ 03/lib"
  6.  
  7. JAVA_HOME = "/home /... /Download/jdk1.7.0 _ 03 /"

At this point, if your UBUNTU has not installed Openjdk, you can skip the following text.

2 optional)

Let's modify Jdk and enter the following code:

 
 
  1. Sudo update-alternatives-install/usr/bin/java/home /... /Download/jdk1.7.0 _ 03/bin/java 300
  2.  
  3. Sudo update-alternatives-install/usr/bin/javac/home /... /Download/jdk1.7.0 _ 03bin/javac 300

Statement: where... Represents my working directory

Select the system default Jdk

 
 
  1. update-alternatives –config java 

After the selection, let's check the downloaded java version.

 
 
  1. java -version  
  2.  
  3. java version “1.7.0_03″  
  4.  
  5. Java(TM) SE Runtime Environment (build 1.7.0_03-b04)  
  6.  
  7. Java HotSpot(TM) Server VM (build 22.1-b02, mixed mode)  

3)

Of course, we must first download the Linux version of Eclipse. Http://www.eclipse.org/downloads/, download and directly decompress it.

Another way is to enter sudo apt-get install eclipse in the terminal.

Now that jdk has been configured, configure Eclipse

Select

Add your JDK to the right of Window-perferences-java-installed JRES

OK, you are done !!!

Go in and have a look.

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.