Visit http://java.sun.com/
於選單指向 Downloads > Java SE
Select Downloads > Java SE
選取 Java 6 Update 18 (JDK) 的選項
(Java 6 Update 18 是 2010-03-16 最新版本)
Select Java 6 Update 18 (JDK)
(Java 6 Update 18 is the latest version on 2010-03-16)
選擇作業系統為 Linux
Select the Operating System as Linux
下載非 RPM 版本的 .bin 檔案 (暫時儲存至 Desktop 位置方便尋找)
Download the Non-RPM version with .bin extension file (Save at Desktop for easy find)
下載 .bin 檔案後開啟 Terminal
Download .bin file and open the Terminal
輸入以下指令
Enter the command below
1 | cd "/home/abc/Desktop" |
abc is the user login name
1 | chmod 0755 "./jdk-6u18-linux-i586.bin" |
change the mode as 755 (or any mode that user can execute this file)
1 | "./jdk-6u18-linux-i586.bin" |
Scroll to the bottom of the agreement and enter yes and press Enter to accept the agreement
處理後輸入
After the process
1 | sudo mv "./jdk1.6.0_18" "/usr/local/jdk1.6.0_18" |
將 JDK 整個目錄移動至 /usr/local 下的目錄分類 (建議)
You need to enter the password when you use sudo
move the JDK directory to /usr/local (Recommended)
1 | sudo gedit "/etc/bash.bashrc" |
After open the gedit, move to the end of file and enter
1 2 3 4 5 | export JAVA_HOME= "/usr/local/jdk1.6.0_18" export JRE_HOME= "${JAVA_HOME}/jre" export JAVA_LIB= "${JRE_HOME}/lib/ext" export PATH= "${PATH}:${JAVA_HOME}/bin" export CLASSPATH= "${CLASSPATH}:.:${JAVA_HOME}/lib:${JRE_HOME}/lib:${JAVA_LIB}" |
之後開啟新 terminal 或開啟 terminal 新分頁輸入 jar 、 java 及 javac
若出輸指令選項表示設定完成可以使用 JDK
若出輸 command not found 則指 JDK 安裝失敗或未設定完成 /etc/bash.bashrc,有需要時由頭重新安裝及設定
Open the Terminal and enter jar or java or javac
If that command shows the Java menu that means you are success to install JDK
otherwise it will show "command not found" that means the JDK install failed or you do not setup the /etc/bash.bashrc file completely, you need to re-install the JDK or edit the /etc/bash.bashrc again
沒有留言 :
張貼留言