感谢支持
我们一直在努力

CentOS 7安装Oracle JDK

CentOS 7安装Oracle JDK,查看Linux是否自带的JDK,如有openJDK,则卸载

java -version

CentOS 7安装Oracle JDK

rpm -qa | grep -E ‘^open[jre|jdk]|j[re|dk]’

CentOS 7安装Oracle JDK

卸载openjdk

su root
yum -y remove java java-1.7.0-openjdk

CentOS 7安装Oracle JDK

下载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

CentOS 7安装Oracle JDK

解压jdk

tar -xzvf jdk-8u77-linux-x64.tar.gz

CentOS 7安装Oracle JDK

移动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

CentOS 7安装Oracle JDK

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

赞(0) 打赏
转载请注明出处:服务器评测 » CentOS 7安装Oracle JDK
分享到: 更多 (0)

听说打赏我的人,都进福布斯排行榜啦!

支付宝扫一扫打赏

微信扫一扫打赏