[b]1.update-alternatives[/b]
参考网上帖子安装jdk时,都会有如下配置,但很少有解释command结尾的数字代表什么意思
。[url=http://persevere.iteye.com/blog/1479524]update-alternatives[/url]是uubuntu中专门维护系统链接符的工具。其中结尾数字是更改后的优先级。
在这片博客中[url=http://shinephp.com/install-jdk-7-on-ubuntu/]Install JDK 7 on Ubuntu[/url],作者有这么两段段描述[quote]sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0/jre/bin/java 3
to add your new JDK 7 installation into alternatives list. I put 3 there as 2 was last number for my configuration. You should use your own number from the previous step increased by 1.[/quote][quote] sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk1.7.0/jre/bin/java 0
This will select needed java version in case you had not any previous java version installed before.[/quote]所以这个数字不是一味的填写300。这片博客中也有提到。[url=http://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7]How do I install Oracle Java JDK 7?[/url]
参考网上帖子安装jdk时,都会有如下配置,但很少有解释command结尾的数字代表什么意思
。[url=http://persevere.iteye.com/blog/1479524]update-alternatives[/url]是uubuntu中专门维护系统链接符的工具。其中结尾数字是更改后的优先级。
sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/java-7-sun/bin/java 300
sudo update-alternatives --install /usr/bin/javac javac /usr/lib/jvm/java-7-sun/bin/javac 300
在这片博客中[url=http://shinephp.com/install-jdk-7-on-ubuntu/]Install JDK 7 on Ubuntu[/url],作者有这么两段段描述[quote]sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.7.0/jre/bin/java 3
to add your new JDK 7 installation into alternatives list. I put 3 there as 2 was last number for my configuration. You should use your own number from the previous step increased by 1.[/quote][quote] sudo update-alternatives –install /usr/bin/java java /usr/lib/jvm/jdk1.7.0/jre/bin/java 0
This will select needed java version in case you had not any previous java version installed before.[/quote]所以这个数字不是一味的填写300。这片博客中也有提到。[url=http://askubuntu.com/questions/55848/how-do-i-install-oracle-java-jdk-7]How do I install Oracle Java JDK 7?[/url]