464226150
464226150

ubuntu安装配置JDK

安装:sudo sh jdk-6u31-linux-i586.bin
配置:sudo gedit /etc/environment

usr/games:/home/laoying/soft/jvm/jdk1.6.0_31/bin"
CLASSPATH="/home/laoying/soft/jvm/jdk1.6.0_31/jre/lib"
JAVA_HOME="/home/laoying/soft/jvm/jdk1.6.0_31"

update-alternatives --install /usr/bin/java java /usr/lib/jvm/java/jdk1.6.0_12 /bin/java 300
update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java/jdk1.6.0_12/bin/javac 300
update-alternatives --config java

java -version可以查看到java版本,但测试HelloWorld不能通过
解决:在测试HelloWorld时,以root权限进行测试,即在命令前加上sudo,通过。