1、安装JAVA
(1)首先添加源:
sudo gedit /etc/apt/sources.list
在打开的文件中添加如下内容并保存:
deb http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu xenial main
(2)安装密钥:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
(3)执行:
sudo apt-get update
(4)运行安装命令,开始安装JAVA:
sudo apt-get install oracle-java8-installer oracle-java8-set-default
sudo apt-get install --no-install-recommends oracle-java8-installer
(5)查看安装结果:
java -version
javac -version
(6)路径配置
打开.bashrc文件:
gedit .bashrc
在打开的文件中添加路径并保存:
export JAVA_HOME=/usr/lib/jvm/java-8-oracle
export JRE_HOME=${JAVA_HOME}/jre
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib
export PATH=${JAVA_HOME}/bin:$PATH
2、安装Eclipse
(1)从官方网站下载Eclipse C++安装包到本地
(2)解压安装包
(3)将Eclipse移动至/usr/local:
sudo mv <path>/eclipse /usr/local
(4)运行
/sur/local/eclipse/eclipse