1. Install JDK
1. Uninstall the built-in openjava of centos
<1> run the command "rpm-Qa | grep Java", "rpm-Qa | grep JDK", "rpm-Qa | grep jcj" to find an existing package.
<2> run the command "rpm-e -- nodeps jdk-1.7.0_17-fcs.x86_64" to uninstall the package above, jdk-1.7.0_17-fcs.x86_64 installation name
2. Create a directory and install JDK
# Mkdir/usr/Java
# Rpm-IVH jdk-7u17-linux-x64.rpm
The installation is complete. If the following prompt is displayed, skip this step. the installation is successful. this is because your RPM package has directly loaded these files into the jar package, which is not found during unpacking and does not affect normal use.
Unpacking jar files...
Rt. jar...
Error: cocould not open input file:/usr/Java/jdk1.7.0 _ 17/JRE/lib/RT. Pack
JSSE. jar...
Error: cocould not open input file:/usr/Java/jdk1.7.0 _ 17/JRE/lib/JSSE. Pack
Charsets. jar...
Error: cocould not open input file:/usr/Java/jdk1.7.0 _ 17/JRE/lib/charsets. Pack
Tools. jar...
Error: cocould not open input file:/usr/Java/jdk1.7.0 _ 17/lib/tools. Pack
Localedata. jar...
Error: cocould not open input file:/usr/Java/jdk1.7.0 _ 17/JRE/lib/EXT/localedata. Pack
3. Configure Environment Variables
<1> # vi/etc/profile
<2> Add the following lines at the end:
Export java_home =/usr/Java/jdk1.7.0 _ 17 // note that jdk1.7.0 _ 17 indicates the installed JDK directory.
Export classpath =.: $ java_home/JRE/lib/RT. jar: $ java_home/lib/dt. jar: $ java_home/lib/tools. Jar
Export Path = $ path: $ java_home/bin
<3> # reboot // restart the machine. The configuration takes effect.
2. Install eclipse
1. Install C ++
# Yum install GCC gcc-C ++
2. decompress and download Eclipse IDE for C/C ++ developers from the official website, including CDT. No additional installation is required.
3. compile C ++
1. Create a new C ++ project and set the workspace path
2. An error may be reported during the first running: "launch failed, binary not found". If you build the project, you can run it again.