1.从Google code下载jdkhttps://storage.googleapis.com/google-code-archive-downloads/v2/code.google.com/autosetup1/jdk-6u20-linux-i586.bin

2. 修改权限

sudo chmod 777 jdk-6u20-linux-i586.bin

3.运行安装

./jdk-6u20-linux-i586.bin

4.修改环境变量

gedit ~/.bashrc

export JAVA_HOME=/usr/lib/jvm/jdk1.6.0_20
export JRE_HOME=${JAVA_HOME}/jre 
export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib 
export PATH=${JAVA_HOME}/bin:$PATH

5,使能

source ~/.bashrc

6.查看

java -version