歡迎來到Linux教程網
Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux教程

CentOS 7安裝Oracle JDK

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 

Copyright © Linux教程網 All Rights Reserved