Ubuntu 安装eclipse for C++/C

 1. Download JDK and Eclipse for C/C++

 1.1 Download JDK:

  $ wget http://mirror.cnop.net/jdk/linux/jdk-8u112-linux-x64.tar.gz       

LINUX:~/workspace/TOOLS$ wget http://mirror.cnop.net/jdk/linux/jdk-8u112-linux-x64.tar.gz  
--2021-07-29 10:04:51--  http://mirror.cnop.net/jdk/linux/jdk-8u112-linux-x64.tar.gz
Resolving mirror.cnop.net (mirror.cnop.net)... 103.79.79.167
Connecting to mirror.cnop.net (mirror.cnop.net)|103.79.79.167|:80... connected.
HTTP request sent, awaiting response... 301 Moved Permanently
Location: https://mirror.cnop.net/jdk/linux/jdk-8u112-linux-x64.tar.gz [following]
--2021-07-29 10:04:54--  https://mirror.cnop.net/jdk/linux/jdk-8u112-linux-x64.tar.gz
Connecting to mirror.cnop.net (mirror.cnop.net)|103.79.79.167|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 183212596 (175M) [application/octet-stream]
Saving to: ‘jdk-8u112-linux-x64.tar.gz’

jdk-8u112-linux-x64.tar.gz       100%[=========================================================>] 174.72M  4.19MB/s    in 36s     

2021-07-29 10:05:31 (4.85 MB/s) - ‘jdk-8u112-linux-x64.tar.gz’ saved [183212596/183212596]

 1.2 Download eclipse

 $wget https://mirrors.tuna.tsinghua.edu.cn/eclipse/technology/epp/downloads/release/neon/3/eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz   

LINUX:~/workspace/TOOLS$ wget https://mirrors.tuna.tsinghua.edu.cn/eclipse/technology/epp/downloads/release/neon/3/eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz
--2021-07-29 10:06:00--  https://mirrors.tuna.tsinghua.edu.cn/eclipse/technology/epp/downloads/release/neon/3/eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 2402:f000:1:408:8100::1, 101.6.8.193
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|2402:f000:1:408:8100::1|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 197432205 (188M) [application/octet-stream]
Saving to: ‘eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz’

eclipse-cpp-neon-3-linux-gtk-x86 100%[=========================================================>] 188.29M  11.0MB/s    in 24s     
2021-07-29 10:06:24 (7.82 MB/s) - ‘eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz’ saved [197432205/197432205]

  2. Install JDK and Eclipse

  2.1 intall JDK

  $ sudo tar xvzf  jdk-8u112-linux-x64.tar.gz -C /usr/lib/jvm/

  Add java env to ~/.bashrc

export JAVA_HOME=/usr/lib/jvm/jdk1.8.0_112
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH

  $ source ~/.bashrc   

  check java version:

LINUX$ java -version
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b15)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b15, mixed mode)

  2.2 install eclipse

  $ sudo tar xvzf eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz -C /opt/

  add eclipse to desktop:

  $sudo vim /usr/share/applications/eclipse.desktop

  if eclipse.desktop file is not exist, touch eclipse.desktop and edit it.

  eclipse.desktop:

[Desktop Entry]
#Type=Application
#Name=Eclipse
#Comment=Eclipse Integrated Development Environment
#Icon=eclipse
#Exec=eclipse
#Terminal=false
#Categories=Development;IDE;Java;
Name=Eclipse
Type=Application
Exec=/opt/eclipse/eclipse
Terminal=false
Icon=/opt/eclipse/icon.xpm
Comment=Integrated Development Environment
NoDisplay=false
Categories=Development;IDE;
Name[en]=Eclipse

   

 

               

你可能感兴趣的:(Linux开发)