我尝试按如下方式安装 Java 6:
chmod +x jdk-6u45-linux-x64.bin
./jdk-6u45-linux-x64.bin
sudo mkdir /usr/lib/jvm
sudo mv jdk1.6.0_45 /usr/lib/jvm
sudo update-alternatives --install "/usr/bin/java" "java" /usr/lib/jvm/jdk1.6.0_45/bin/java" 1
sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_45/bin/javac" 1
sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.6.0_45/bin/javaws" 1
sudo update-alternatives --config java
sudo update-alternatives --config javac
sudo update-alternatives --config javaws
ls -la /etc/alternatives/java*
之后我用检查java -version
,但它给出了以下错误消息:
Error occurred during initialization of VM
Unable to load native library: libnsl.so.1: cannot open shared object file:
No such file or directory