1:下載地址http://code.google.com/p/autosetup1/downloads/detail?name=jdk-6u20-linux-i586.bin&can=2&q
2:安裝:
sudo -s ./jdk-6u20-linux-i586.bin
3:配置環境變量
sudo vim /etc/profile
最后添加
export JAVA_HOME=/home/bestupon/jdk1.6.0_20 export JRE_HOME=/home/bestupon/jdk1.6.0_20/jre export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH export PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
4:使環境變量生效
source /etc/profile
5:檢驗是否安裝
java -version
出現
java version "1.6.0_20" Java(TM) SE Runtime Environment (build 1.6.0_20-b02) Java HotSpot(TM) Server VM (build 16.3-b01, mixed mode)
表示安裝正確
6:錯誤:
ailed to extract the files. Please refer to the Troubleshooting section of the Installation Instructions on the download page for more information
這種錯誤是因為版本不匹配造車的,這個安裝包是64位的,你的系統是32位的,
7:查看ubuntu是多少位
命令:uname -ar
Linux ubuntu 3.2.0-24-generic #37-Ubuntu SMP Wed Apr 25 08:43:22 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
這是64位的,如果是32位的一般是i386或者i686