CentOS 7安装Oracle JDK,查看Linux是否自带的JDK,如有openJDK,则卸载
java -version
rpm -qa | grep -E ‘^open[jre|jdk]|j[re|dk]’
卸载openjdk
su root
yum -y remove java java-1.7.0-openjdk
下载oracle jdk
wget –no-cookies –header “Cookie: oraclelicense=accept-securebackup-cookie;” http://download.oracle.com/otn-pub/java/jdk/8u77-b03/jdk-8u77-linux-x64.tar.gz
解压jdk
tar -xzvf jdk-8u77-linux-x64.tar.gz
移动jdk到/usr/local,建立软连接
mv jdk1.8.0_77/ /usr/local
ln -s /usr/local/jdk1.8.0_77/ /usr/local/jdk
编辑/etc/profile
vim /etc/profile
加入jdk的配置
JAVA_HOME=/usr/local/jdk
PATH=${PATH}:${JAVA_HOME}/bin
export JAVA_HOME PATH
source
source /etc/profile
查看是否安装jdk成功
java -version
Ubuntu 14.04安装JDK1.8.0_25与配置环境变量 http://www.linuxidc.com/Linux/2015-01/112030.htm
CentOS 搭建JDK环境 http://www.linuxidc.com/Linux/2015-06/118879.htm
Ubuntu 14.04安装JDK1.8.0_25与配置环境变量 http://www.linuxidc.com/Linux/2015-01/112030.htm
Ubuntu 14.04 LTS安装Oracle JDK 1.8 http://www.linuxidc.com/Linux/2014-11/109216.htm
CentOS6.3安装JDK和环境配置 http://www.linuxidc.com/Linux/2012-09/70780.htm
Ubuntu 14.04 安装 JDK8 http://www.linuxidc.com/Linux/2014-09/106218.htm
Ubuntu下安装JDK图文解析 http://www.linuxidc.com/Linux/2014-09/107291.htm
本文永久更新链接地址:http://www.linuxidc.com/Linux/2016-04/129785.htm