--------------------------------------------------------------------------------------------
本文系本站原创,欢迎转载!
转载请注明出处:http://blog.csdn.net/gdt_a20/article/details/7307681
--------------------------------------------------------------------------------------------
1.sudo mkdir /usr/lib/jvm/sunjdk
2. wget http://download.oracle.com/otn-pub/java/jdk/6u31-b04/jdk-6u31-linux-i586.bin
3.chmod a+x /jdk-6u31-linux-i586.bin
4.sudo ./jdk-6u31-linux-i586.bin
5.gedit ~/.bashrc
6.add
export JAVA_HOME=/usr/lib/jvm/sunjdk/jdk1.6.0_31/
export PATH=$PATH:$JAVA_HOME/bin
7.source ~/.bashrc
8./usr/lib/jvm/sunjdk/jdk1.6.0_31/bin$ java -version
java version "1.6.0_31"
Java(TM) SE Runtime Environment (build 1.6.0_31-b04)
Java HotSpot(TM) Server VM (build 20.6-b01, mixed mode)
That's all.