1:下載地址http://code.google.com/p/autosetup1/downloads/detail?name=jdk-6u20-linux-i586.bin&can=2&qjava
2:安裝:linux
sudo -s ./jdk-6u20-linux-i586.bin
3:配置環境變量ubuntu
sudo vim /etc/profile
最後添加vim
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:使環境變量生效ui
source /etc/profile
5:檢驗是否安裝google
java -version
出現spa
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)
表示安裝正確code
6:錯誤:orm
ailed to extract the files. Please refer to the Troubleshooting section of the Installation Instructions on the download page for more informationblog
這種錯誤是由於版本不匹配造車的,這個安裝包是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