Ubuntu16.04安装eclipse for C++

1准备工作

1.1在/opt内新建文件夹jvm

cd /opt
sudo mkdir jvm

1.2在jvm中下载 jdk-8u112-linux-x64.tar.gzeclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz.

cd /opt/jvm 
wget http://mirror.cnop.net/jdk/linux/jdk-8u112-linux-x64.tar.gz  
wget https://mirrors.tuna.tsinghua.edu.cn/eclipse/technology/epp/downloads/release/neon/3/eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz

2安装JDK

2.1解压

cd /opt/jvm
tar zxvf jdk-8u121-linux-x64.tar.gz -C /opt

2.2配置jdk环境变量

打开profile:

sudo gedit /etc/profile

在最后添加:

export JAVA_HOME=/opt/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 /etc/profile

检查一下是否安装成功:

java -version

3安装Eclipse

3.1解压eclipse

cd /opt/
sudo tar zxvf eclipse-cpp-neon-3-linux-gtk-x86_64.tar.gz -C /opt/

3.2创建eclipse桌面快捷图标

终端输入:

sudo gedit /usr/share/applications/eclipse.desktop

注:如果没有eclipse.desktop文件的话则新建一个:

cd /usr/share/applications
sudo touch eclipse.desktop

粘贴并保存如下内容:

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

保存,退出,完成


本文参考:
[1] ubuntu 16.04 安装 eclipse c++
[2] 在Ubuntu中安装eclipse图文详解
[3] Ubuntu16.04LTS傻瓜式安装Eclipse图文详情加注释


你可能感兴趣的:(工具)