Build the ubuntu eclipse C ++ Environment

Source: Internet
Author: User

Build the ubuntu eclipse C ++ Environment
Install the java Development Environment package JDK

Step 1: Download jdk-7-linux-i586.tar.gz
 

wget -c http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-i586.tar.gz  

(Note: If the download fails, we recommend that you use thunder to download it and copy it to the Linux system .)
Step 2: unzip and install
 

sudo tar zxvf ./jdk-7-linux-i586.tar.gz  -C /usr/lib/jvm  cd /usr/lib/jvm  sudo mv jdk1.7.0/ java-7-sun  

Step 3: Modify Environment Variables
 

vim ~/.bashrc  

Add:
 

export JAVA_HOME=/usr/lib/jvm/java-7-sun  export JRE_HOME=${JAVA_HOME}/jre  export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib  export PATH=${JAVA_HOME}/bin:$PATH  

Save and exit. Enter the following command to make it take effect immediately.
 

source ~/.bashrc  

Step 4: configure the default JDK version (if other JDK versions are included)
Ubuntu may have a default JDK, such as openjdk. To set the JDK we installed as the default JDK version, perform the following work.
Run the Code:
 

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-sun/bin/java 300  sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-sun/bin/javac 300  sudo update-alternatives --install /usr/bin/jar jar /usr/lib/jvm/java-7-sun/bin/jar 300   sudo update-alternatives --install /usr/bin/javah javah /usr/lib/jvm/java-7-sun/bin/javah 300   sudo update-alternatives --install /usr/bin/javap javap /usr/lib/jvm/java-7-sun/bin/javap 300   

Run the Code:
 

sudo update-alternatives --config java  

JDK versions are listed as follows:
 

Snowdream @ snowdream :~ $ Sudo update-alternatives -- config java has three candidates to replace java (/usr/bin/java ). Select path priority status ready * 0/usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 automatic mode 1/usr/lib/jvm/java-6-openjdk/jre/bin/java 1061 manual mode 2/usr/lib/jvm/java-6-sun/jre/bin/java 63 manual mode 3/usr/lib/jvm/java-7-sun/bin/ to maintain the current value in java 300 manual mode [*], press Enter, alternatively, enter the selected number: 3 update-alternatives:/usr/lib/jvm/java-7-sun/bin/java to provide/usr/bin/java (java ), in manual mode.

Step 5: Test

snowdream@snowdream:~$ java -version  java version "1.7.0"  Java(TM) SE Runtime Environment (build 1.7.0-b147)  Java HotSpot(TM) Server VM (build 21.0-b17, mixed mode)
Install Eclipse

2. Download Eclipse

Download the appropriate version, such as Eclipse IDE for C/C ++ Developers.

3. decompress the file
Sudomveclipse? Cpp? Juno? M7? Linux? Gtk.tar.gz/usr/lib/ Cd/usr/lib/
Sudotar? Zxvfeclipse? Cpp? Juno? M7? Linux? Gtk.tar.gz Sudo rm./eclipse-cpp-juno-M7-linux-gtk.tar.gz

4. Create a startup shortcut
$ Sudo gedit/usr/share/applications/eclipse. desktop
The content is as follows:

 

Type=ApplicationName=EclipseComment=Eclipse Integrated Development EnvironmentIcon=/usr/lib/eclipse/icon.xpmExec=/usr/lib/eclipse/eclipseTerminal=falseCategories=Development;IDE;Java;

5. Localization
Download the Chinese package of the corresponding version.
1) Select the latest Babel Language Pack Zips and Update Sites-R0.9.1 Indigo.
2) Select the BabelLanguagePack-eclipse-zh_3.7.0.v20111128043401.zip under Language: Chinese (Simplified)
3) decompress the file
SudounzipBabelLanguagePack? Eclipse? Zh3.7.0.v20111128043401.zip Sudo mv./eclipse/plugins/*/usr/lib/eclipse/plugins/
Sudomv./eclipse/features /? /Usr/lib/eclipse/features/ Sudo rm-r eclipse
 

Install the cdt plug-in

Download cdt-8.4.0.zip
Open eclipse-> help-> install new software-> add-> archiveappsinstallation package -8.4.0.zip

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.