标签:jdk
alternatives命令介绍:
alternatives --install <link> <name> <path> <priority>
其中,
install表示安装
link是符号链接
name则是标识符
path是执行文件的路径
priority则表示优先级
比如在某个目录下安装jdk:
在目录/tools/jdk6下安装了java version "1.6.0_12"
[root@localhost test]# alternatives --install /usr/bin/java java /tools/jdk6/bin/java 4
[root@localhost test]# alternatives --config java
There are 4 programs which provide ‘java‘.
Selection Command
-----------------------------------------------
* 1 /usr/lib/jvm/jre-1.7.0-icedtea/bin/java
2 /usr/lib/jvm/jre-1.5.0-gcj/bin/java
+ 3 /tools/jdk/bin/java
4 /tools/jdk6/bin/java
Enter to keep the current selection[+], or type selection number: 4
用alternatives --config java就可以选择你想要的Java版本
alternatives --display java
查询
alternatives --remove java /home/server/jdk1.6.0_21/bin/java 删除
本文出自 “小V运维之路” 博客,请务必保留此出处http://victor2016.blog.51cto.com/6768693/1958548
标签:jdk
原文地址:http://victor2016.blog.51cto.com/6768693/1958548