Linux教程網
Linux教程網
Linux教程網
您现在的位置: Linux教程網 >> UnixLinux >  >> Linux基礎 >> Linux技術

Redhat Linux 安裝 JDK 1.6

本文以 Redhat Linux 為例,說明安裝 JDK 1.6 的流程,其他 Linux 平台概念相近。

步驟一:下載 JDK

下載時要確認系統是 32 位或 64 位,可用 getconf LONG_BIT 查詢。

Redhat Linux 安裝 JDK 1.6Redhat Linux 安裝 JDK 1.6

步驟二:上傳安裝包

可用 FTP 工具上傳 JDK 安裝包。

Redhat Linux 安裝 JDK 1.6

若沒有執行權限,可用 chmod 增加權限。

Redhat Linux 安裝 JDK 1.6Redhat Linux 安裝 JDK 1.6

步驟三:解壓安裝

執行 bin 檔後會產生 rpm 包。

Redhat Linux 安裝 JDK 1.6Redhat Linux 安裝 JDK 1.6

使用 rpm 安裝主程式包。

Redhat Linux 安裝 JDK 1.6Redhat Linux 安裝 JDK 1.6

步驟四:設定環境變數

在 /etc/profile 中加入 JAVA_HOME、JRE_HOME、PATH 與 CLASSPATH。

Redhat Linux 安裝 JDK 1.6

可用 source 讓設定立即生效。

Redhat Linux 安裝 JDK 1.6

步驟五:驗證安裝

輸入 java -version 查看版本。

Redhat Linux 安裝 JDK 1.6

也可建立 Test.java 測試 Hello World。

Redhat Linux 安裝 JDK 1.6Redhat Linux 安裝 JDK 1.6

若安裝失敗,可先卸載 JDK 再重新安裝。

Redhat Linux 安裝 JDK 1.6
Copyright © Linux教程網 All Rights Reserved