"Linux" jdk+eclipse to build C/D + + development environment __ Framework

Source: Internet
Author: User

Turn from: http://www.youranshare.com/blog/sid/25.html

Note: The reference samples provided in this article are installed in the CentOS Linux environment and are not guaranteed to be applicable to other versions of Linux systems.

· Pre-installation considerations

Compiling the source code requires the corresponding code-compiling tool, the eclipse installed in this article is just a shell of code writing, so your Linux system should have a compiler installed so that eclipse can invoke the corresponding compiler when compiling the source code. A small set of GCC installed, that is, my eclipse uses G++/GCC to compile the code. If you haven't installed GCC yet, see:

Installation and compilation of GCC under Linux Linux + + code example

· Download the required files

1, download the JDK you need, you can download the RPM installation package or the GZ compression pack,

Specific to the Oracle website to download: JDK Oracle website Download address

2, download the Linux version of the Eclipse IDE for C/s + +, this you download is a compressed package:

Eclipse Oracle website Download address

For Eclipse's installation, which is generally similar to Windows, first set the JDK and configure the environment variable God horse, Eclipse can be used.

· The first step is to install the JDK and configure the environment variable path

1, will download the JDK compressed solution in the JDK folder to the location you want, such as small edit to the

/usr/java/under this directory, then my JDK's location is '/usr/java/jdk1.7.0_51 '

2. Configure System Environment variables:

Method One:

Use the account with root permission to log in, the small part is using the root account login can modify any file, find the file '/etc/profile ' right to modify the property, the permission in the rights to Read-write, as shown:

Open the profile and add your JDK location information to the export location as shown:

Export java_home=/usr/java/jdk1.7.0_51

Export Java_bin=/usr/java/jdk1.7.0_51/bin

Export path= $PATH: $JAVA _home/bin

Export classpath=.: $JAVA _home/lib/dt.jar: $JAVA _home/lib/tools.jar

Export Java_home java_bin PATH CLASSPATH


You just need to change the first two lines, then close and save the profile, restart to make path effective, and in the terminal input java-version can view the Java version information, as shown in figure:

Method Two:

Modify the '/etc/profile ' file at the end using the command:

① Open the terminal and use the SU command to enter the password to obtain root admin rights

② uses the command to open profile This file on the terminal:

# Vi/etc/profile

③ press ENTER to change the file, the code shown here is exactly the same as in method one, scroll the cursor to the modified position (see method one), press the I button on the keyboard, start the insert operation (the terminal in the lower left corner will be displayed), enter the environment variable configuration into this position, press Esc key, Then press ":" This button, enter exit, you can exit the saved as shown:

As with method one, it's best to restart it, and then use the command java–version to view the Java version information.

· The second step is to install the Eclipse IDE for C + +

Because JDK environment variables are all done, this step is very simple, open your download of the Eclipse compression pack, literally extract to the location you want it, there is an eclipse file under the Eclipse folder, this is the startup file, double-click to start Eclipse.

To create a desktop shortcut:

Right-click on the desktop to create a Launcher and designate the command as the path to the startup icon.

· C + + Hello Word Test

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.