centos6.8安裝jdk8
環境:
系統:centos6.8
JDK:1.8 ,rpm tar.gz
jdk8 下載位置
安裝方法
方法一:手動解壓JDK的壓縮包,設定環境變數
方法二:yum安裝JDK
方法三:用rpm安裝JDK
方法一:手動解壓JDK的壓縮包,設定環境變數
1.建立java目錄
[root@centos6-01 ~]# mkdir /usr/java
[root@centos6-01 ~]# cd /usr/java/
2.下載,然後解壓,這一步我已經將軟體下載並放到/sofwaretar 目錄下
複製到/usr/java
[root@centos6-01 java]# cp /softwaretar/jdk-8u111-linux-x64.tar.gz ./
[root@centos6-01 java]# ll
total 177192
-rw-r--r--. 1 root root 181442359 Dec 23 14:04 jdk-8u111-linux-x64.tar.gz
[root@centos6-01 java]# tar -zxvf jdk-8u111-linux-x64.tar.gz
3.設定環境變數
[root@centos6-01 java]# vi /etc/profile
新增如下內容:
#set java environment
JAVA_HOME=/usr/java/jdk1.8.0_111
JRE_HOME=/usr/java/jdk1.8.0_111/JRE
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
生效修改
[root@centos6-01 java]#source /etc/profile
4.驗證
[root@centos6-01 java]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
方法二:yum安裝JDK
1.檢視yum庫中有那些jdk版本
[root@centos6-01 java]# yum search java|grep jdk
ldapjdk-javadoc.x86_64 : Javadoc for ldapjdk
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-debug.x86_64 : OpenJDK Runtime Environment with full debug on
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.8.0-openjdk-demo-debug.x86_64 : OpenJDK Demos with full debug on
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.8.0-openjdk-devel-debug.x86_64 : OpenJDK Development Environment with
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-headless-debug.x86_64 : OpenJDK Runtime Environment with full
java-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-javadoc-debug.noarch : OpenJDK API Documentation for packages
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk-src-debug.x86_64 : OpenJDK Source Bundle for packages with
ldapjdk.x86_64 : The Mozilla LDAP Java SDK
2.選擇版本,進行安裝
[root@centos6-01 java]# yum install java-1.8.0-openjdk
3.設定環境變數
[root@centos6-01 java]# vi /etc/profile
新增如下內容:
#set java environment
JAVA_HOME= /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-0.b15.el6_8.x86_64/
JRE_HOME= /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-0.b15.el6_8.x86_64//JRE
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
生效修改
[root@centos6-01 java]#source /etc/profile
4.驗證
[root@centos6-01 java]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
方法三:用rpm安裝JDK
1. 下載
已下載軟體到/usr/java 目錄下
2.使用rpm命令安裝
rpm -ivh jdk-8u111-linux-x64.rpm
3.設定環境變數
[root@centos6-01 java]# vi /etc/profile
新增如下內容:
#set java environment
JAVA_HOME=/usr/java/jdk1.8.0_111
JRE_HOME=/usr/java/jdk1.8.0_111/JRE
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
生效修改
[root@centos6-01 java]#source /etc/profile
4.驗證
[root@centos6-01 java]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
系統:centos6.8
JDK:1.8 ,rpm tar.gz
jdk8 下載位置
安裝方法
方法一:手動解壓JDK的壓縮包,設定環境變數
方法二:yum安裝JDK
方法三:用rpm安裝JDK
方法一:手動解壓JDK的壓縮包,設定環境變數
1.建立java目錄
[root@centos6-01 ~]# mkdir /usr/java
[root@centos6-01 ~]# cd /usr/java/
2.下載,然後解壓,這一步我已經將軟體下載並放到/sofwaretar 目錄下
複製到/usr/java
[root@centos6-01 java]# cp /softwaretar/jdk-8u111-linux-x64.tar.gz ./
[root@centos6-01 java]# ll
total 177192
-rw-r--r--. 1 root root 181442359 Dec 23 14:04 jdk-8u111-linux-x64.tar.gz
[root@centos6-01 java]# tar -zxvf jdk-8u111-linux-x64.tar.gz
3.設定環境變數
[root@centos6-01 java]# vi /etc/profile
新增如下內容:
#set java environment
JAVA_HOME=/usr/java/jdk1.8.0_111
JRE_HOME=/usr/java/jdk1.8.0_111/JRE
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
生效修改
[root@centos6-01 java]#source /etc/profile
4.驗證
[root@centos6-01 java]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
方法二:yum安裝JDK
1.檢視yum庫中有那些jdk版本
[root@centos6-01 java]# yum search java|grep jdk
ldapjdk-javadoc.x86_64 : Javadoc for ldapjdk
java-1.6.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.6.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.6.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.6.0-openjdk-javadoc.x86_64 : OpenJDK API Documentation
java-1.6.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.7.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.7.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.7.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.7.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.7.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-debug.x86_64 : OpenJDK Runtime Environment with full debug on
java-1.8.0-openjdk-demo.x86_64 : OpenJDK Demos
java-1.8.0-openjdk-demo-debug.x86_64 : OpenJDK Demos with full debug on
java-1.8.0-openjdk-devel.x86_64 : OpenJDK Development Environment
java-1.8.0-openjdk-devel-debug.x86_64 : OpenJDK Development Environment with
java-1.8.0-openjdk-headless.x86_64 : OpenJDK Runtime Environment
java-1.8.0-openjdk-headless-debug.x86_64 : OpenJDK Runtime Environment with full
java-1.8.0-openjdk-javadoc.noarch : OpenJDK API Documentation
java-1.8.0-openjdk-javadoc-debug.noarch : OpenJDK API Documentation for packages
java-1.8.0-openjdk-src.x86_64 : OpenJDK Source Bundle
java-1.8.0-openjdk-src-debug.x86_64 : OpenJDK Source Bundle for packages with
ldapjdk.x86_64 : The Mozilla LDAP Java SDK
2.選擇版本,進行安裝
[root@centos6-01 java]# yum install java-1.8.0-openjdk
3.設定環境變數
[root@centos6-01 java]# vi /etc/profile
新增如下內容:
#set java environment
JAVA_HOME= /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-0.b15.el6_8.x86_64/
JRE_HOME= /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.111-0.b15.el6_8.x86_64//JRE
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
生效修改
[root@centos6-01 java]#source /etc/profile
4.驗證
[root@centos6-01 java]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
方法三:用rpm安裝JDK
1. 下載
已下載軟體到/usr/java 目錄下
2.使用rpm命令安裝
rpm -ivh jdk-8u111-linux-x64.rpm
3.設定環境變數
[root@centos6-01 java]# vi /etc/profile
新增如下內容:
#set java environment
JAVA_HOME=/usr/java/jdk1.8.0_111
JRE_HOME=/usr/java/jdk1.8.0_111/JRE
CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib
PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin
export JAVA_HOME JRE_HOME CLASS_PATH PATH
生效修改
[root@centos6-01 java]#source /etc/profile
4.驗證
[root@centos6-01 java]# java -version
java version "1.8.0_111"
Java(TM) SE Runtime Environment (build 1.8.0_111-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.111-b14, mixed mode)
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/28282660/viewspace-2131288/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- centos6.8安裝nodeCentOS
- CentOs6.8 yum安裝GitLabCentOSGitlab
- Jdk8的安裝JDK
- centos安裝jdk8CentOSJDK
- CentOS6.8安裝配置sonarqube6.4CentOS
- CentOs6.8上安裝maven本地倉庫CentOSMaven
- centos6.8 靜默安裝 oracle 11.2.0.4CentOSOracle
- centos安裝jdk8,安裝IntelliJ IdeaCentOSJDKIntelliJIdea
- CentOS 7 - 安裝Oracle JDK8CentOSOracleJDK
- Centos7安裝jdk8CentOSJDK
- CentOS6.8 安裝python2.7,pip以及yumCentOSPython
- centos6.8安裝mysql並配置遠端登陸CentOSMySql
- 安裝JDK8出現安裝Jre的視窗JDK
- Centos6.8系統安裝程式碼防毒軟體:ClamAVCentOS防毒
- Linux下jdk8安裝步驟LinuxJDK
- Centos6.8下編譯安裝LAMP的操作記錄梳理CentOS編譯LAMP
- 分享Linux下安裝jdk8步驟LinuxJDK
- Linux下安裝jdk8步驟詳述LinuxJDK
- kvm之四:從網上映象安裝虛擬機器Centos6.8虛擬機CentOS
- centos6.8下安裝部署LNMP-(nginx1.8.0+php5.6.10+mysql5.6.12)CentOSLNMPNginxPHPMySql
- windows伺服器系統下安裝JDK8的教程圖解Windows伺服器JDK圖解
- Windows10下JDK8的下載安裝與環境變數的配置WindowsJDK變數
- windows10如何安裝jdk8,並且配置java home環境?超詳細!WindowsJDKJava
- jdk8安裝後兩個資料夾,分別是jre、jdk表示什麼?JDK
- jdk8JDK
- Java JDK8 Windows XP安裝與“無... RegDeleteKeyExA 於... ADVAPI32.dll”的解決JavaJDKWindowsdeleteAPI
- CentOS6.8搭建Pure-FTPd1.0.46CentOSFTP
- centos6.8防火牆操作與配置CentOS防火牆
- codis安裝 (java 安裝 + zookeeper 安裝 + go 安裝 + codis 安裝JavaGo
- JDK8新特性JDK
- JDK8的新特性JDK
- JDK8的排序大法!!JDK排序
- 安裝npm 解除安裝npm 安裝apidocNPMAPI
- 基於centos6.8配置多網路卡繫結CentOS
- mysql安裝 (yum 安裝)MySql
- MMM安裝、MHA安裝
- mysql安裝------RPM包安裝及解除安裝MySql
- oracle安裝:OUI安裝Oracle(圖形介面安裝)OracleUI