Centos7安裝jdk8
更新系統軟體
yum update
查詢系統已安裝的jdk元件
rpm -qa | grep -E `^open[jre|jdk]|j[re|dk]`
檢視java版本
java -version
解除安裝以前已有的jdk
yum remove java-1.6.0-openjdk
yum remove java-1.7.0-openjdk
在/usr目錄中先建名為java的資料夾
mkdir /usr/java
下載jdk-8u111-linux-x64.tar.gz包,並上傳至伺服器/usr/local資料夾中。
解壓jdk-8u111-linux-x64.tar.gz包至/usr/local/jdk1.8.0_111資料夾tar -xvf jdk-8u111-linux-x64.tar.gz
新增到環境變數
編輯/etc/profile檔案,在export PATH USER LOGNAME MAIL HOSTNAME HISTSIZE HISTCONTROL下面新增如下程式碼:
export JAVA_HOME=/usr/local/jdk1.8.0_111
export PATH=$JAVA_HOME/bin:$PATH
export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar
執行命令使配置生效source /etc/profile
驗證,是否安裝成功java -version
相關文章
- Jdk8的安裝JDK
- centos安裝jdk8CentOSJDK
- centos安裝jdk8,安裝IntelliJ IdeaCentOSJDKIntelliJIdea
- CentOS 7 - 安裝Oracle JDK8CentOSOracleJDK
- centos6.8安裝jdk8CentOSJDK
- Centos7安裝安裝部署dockerCentOSDocker
- CentOS7安裝php、安裝MySqlCentOSPHPMySql
- 安裝JDK8出現安裝Jre的視窗JDK
- 安裝centos7最小化安裝CentOS
- Linux下jdk8安裝步驟LinuxJDK
- CentOS7 安裝 memcacheCentOS
- CentOS7 安裝 dockerCentOSDocker
- CentOS7 安裝 MySQLCentOSMySql
- CentOS7安裝RedisCentOSRedis
- Centos7 安裝ffmpegCentOS
- centos7安裝protobufCentOS
- 4.1 CentOS7安裝CentOS
- CentOS7 安裝NginxCentOSNginx
- centos7 安裝pipCentOS
- Centos7安裝RabbitMQCentOSMQ
- centos7安裝dockerCentOSDocker
- centos7安裝iptablesCentOS
- CentOS7安裝xrdpCentOS
- centos7 安裝rocketmqCentOSMQ
- centos7 安裝 rcloneCentOS
- centos7安裝mysqlCentOSMySql
- Centos7 安裝 NginxCentOSNginx
- centos7安裝nginxCentOSNginx
- centos7安裝教程詳解 centos7安裝詳細步驟CentOS
- 分享Linux下安裝jdk8步驟LinuxJDK
- CentOS7 下安裝 ElasticsearchCentOSElasticsearch
- centos7下安裝ffmpegCentOS
- centos7 docker 安裝教程CentOSDocker
- vmware 線上安裝 CentOS7CentOS
- Centos7快速安裝RocketMQCentOSMQ
- centos7快速安裝dockerCentOSDocker
- CentOS7安裝wpsCentOS
- centOs7安裝最新dockerCentOSDocker