CentOS 6.4 64位 安裝 jdk 6u45

來源:互聯網
上載者:User

標籤:

準備:

1、下載曆史版本jdk 

地址: http://java.sun.com/products/archive/

 

下載的版本 jdk-6u45-linux-x64-rpm.bin

 Linux x64 65.69 MB   jdk-6u45-linux-x64-rpm.bin

 

 

2、卸載CentOS 預設安裝的 openjdk

  查看已安裝的版本

[[email protected] ~]# rpm -qa | grep java 

  將會列出安裝的 openjdk ,根據列出內容進行卸載

[[email protected] ~]# rpm -e --nodeps java-1.7.0-openjdk-1.7.0.9-2.3.4.1.el6_3.x86_64
[[email protected] ~]# rpm -e --nodeps ava-1.6.0-openjdk-1.6.0.0-1.50.1.11.5.el6_3.x86_64

 

安裝:

  到 安裝包 jdk-6u45-linux-x64-rpm.bin 目錄下賦予檔案可執行許可權再進行執行安裝,jdk將預設安裝到 /usr/java/ 目錄下

[[email protected] ~]# chmod a+x jdk-6u45-linux-x64-rpm.bin
[[email protected] ~]# ./jdk-6u45-linux-x64-rpm.bin

 

 

配置環境變數:

  編輯 /etc/profile 檔案並在最下方添加環境變數

[[email protected] ~]# vi /etc/profile
export JAVA_HOME=/usr/java/jdk1.6.0_45export PATH=$/usr/java/jdk1.6.0_45/bin:$PATHexport CLASSPATH=.:$/usr/java/jdk1.6.0_45/lib/dt.jar:$/usr/java/jdk1.6.0_45/lib/tools.jarexport JAVA_HOME PATH CLASSPATH

使修改生效

[[email protected] ~]#source /etc/profile

 

查看安裝版本:

[[email protected] ~]# java -versionjava version "1.6.0_45"Java(TM) SE Runtime Environment (build 1.6.0_45-b06)Java HotSpot(TM) 64-Bit Server VM (build 20.45-b01, mixed mode)

 

CentOS 6.4 64位 安裝 jdk 6u45

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.