1)下载jdk-6u45-linux-x64.bin.tar.**
2)放到某目录下 解压
3)执行以下命令
chmod +x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
mkdir -p /usr/lib/jvm
mv jdk1.6.0_45 /usr/lib/jvm
update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_45/bin/java" 1
update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_45/bin/javac" 1
update-alternatives --install "/usr/bin/javadoc" "javadoc" "/usr/lib/jvm/jdk1.6.0_45/bin/javadoc" 1
update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jdk1.6.0_45/jre/lib/amd64/libnpjp2.so" 1
update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_45/bin/javaws" 1
update-alternatives --install "/usr/bin/jar" "jar" "/usr/lib/jvm/jdk1.6.0_45/bin/jar" 1
update-alternatives --config java
update-alternatives --config javac
update-alternatives --config javadoc
update-alternatives --config mozilla-javaplugin.so
update-alternatives --config javaws
update-alternatives --config jar
4)用以下命令检查
java -version
javac -version
版权声明:本文为博主原创文章,未经博主允许不得转载。