2010-03-15

於 Ubuntu 手動安裝 Java Development Kits (Manuel install the Java Development Kits in Ubuntu)

前往 http://java.sun.com/
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

cd "/home/abc/Desktop"
abc 是使用者登入名稱
abc is the user login name

chmod 0755 "./jdk-6u18-linux-i586.bin"
改變檔案模式為 755 (或任何使用者可存取的模式)
change the mode as 755 (or any mode that user can execute this file)

"./jdk-6u18-linux-i586.bin"
出現一份 agreement 將文章移至最底並輸入 yes 後等待處理
Scroll to the bottom of the agreement and enter yes and press Enter to accept the agreement

處理後輸入
After the process
sudo mv "./jdk1.6.0_18" "/usr/local/jdk1.6.0_18"
第一次使用 sudo 後需要輸入使用者登入密碼
將 JDK 整個目錄移動至 /usr/local 下的目錄分類 (建議)
You need to enter the password when you use sudo
move the JDK directory to /usr/local (Recommended)

sudo gedit "/etc/bash.bashrc"
開啟 gedit 後在文件最尾的位置輸入
After open the gedit, move to the end of file and enter

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 新分頁輸入 jarjavajavac
若出輸指令選項表示設定完成可以使用 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

沒有留言 :

張貼留言