I typed:

sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/ jdk1.8.0/bin/java" 1

It's says alternatives --install needs link name path priority

asked Jul 5 '14 at 16:22

Swapnil
5718
 
    
What are you typing exactly? please be careful with any punctuation (e.g. dashes) and spaces
– 
steeldriver
Jul 5 '14 at 16:42
    
@steeldriver could you
explain link name path priority . If there were no link like
"/user/bin/java/" then will erroneous result?
– 
Swapnil
Jul 5 '14 at 16:53
    
It should create the link (and the name if there is no current java group in /etc/alternatives). AFAIK the only thing that must pre-exist is the path component i.e. /usr/lib/jvm/jdk1.8.0/bin/java - but note that (as posted in your question) you have a space in yours - hence my 1st comment.
– 
steeldriver
Jul 5 '14 at 16:58
    
@steeldriver yeah
/usr/lib/jvm/bin/java/ is available . I've try sudo update-alternatives
-- install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.8.0.05/bin/java" 1
– 
Swapnil
Jul 5 '14 at 17:22
    
Are you leaving a space between the -- and the word install? if so, don't - it needs to be --install. Also the quotes should not be necessary, just sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0.05/bin/java 1
– 
steeldriver
Jul 5 '14 at 17:35

2 Answers

up vote
3
down vote

accepted

Are you leaving a space between the -- and the word install? if so, don't - it needs to be --install

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jdk1.8.0.05/bin/java 1

The quotes should not be necessary since none of the elements have embedded spaces - although they shouldn't do any harm.

answered Jul 5 '14 at 17:45
steeldriver
13.6k31434
 

This is beacause this command maintains symbolic links. I recommend to execute man update-alternatives to get more information about the command.

update-alternatives --Install的更多相关文章

  1. dpkg --add-architecture i386 && apt-get update && > apt-get install wine32

    dpkg --add-architecture i386 && apt-get update &&> apt-get install wine32

  2. Mac解决:xcode-select: error: command line tools are already installed, use "Software Update" to install updates

    1.因为node项目终端报错: No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'. No receipt for 'com ...

  3. 关于CocoaPods update/CocoaPods install 慢、没反应、卡住的解决方案(Pods升级步骤)

    pod管理第三方库带来的便利大家有目共睹,但是--,估计有很多人会遇到这样一种尴尬情况: Pod install 或 Pod update  执行之后,就不动了,一直一个界面简直要崩溃... 网上有很 ...

  4. Team Foundation Server 2013 with Update 3 Install LOG

    [Info   @10:14:58.155] ====================================================================[Info   @ ...

  5. Howto Setup yum repositories to update or install package from ISO CDROM Image

    Step # 1: Mount an ISO file Type the following command (replace iso file name with the actual iso fi ...

  6. Ubuntu虚拟机可以上网,可以ping网络,但是无法update和install,报连接不上服务器的错误解决方案:

    http://askubuntu.com/questions/711889/err-apt-get-update-on-ubuntu-14-04即使给Ubuntu配置了代理,terminal能ping ...

  7. CentOS系统、Jdk、Tomcat安装实战

    CentOS系统.Jdk.Tomcat安装实战                                                     第一次接触Liunx系统,都说J2EE系统在Li ...

  8. Install Oracle Java JDK/JRE 7u55 on Fedora 20/19, CentOS/RHEL 6.5/5.10

    What’s new in Sun/Oracle Java 7 VM Compressed 64-bit object pointers Garbage-First GC (G1) JSR 292: ...

  9. Linux 命令 alternatives和update-alternatives

    参考: http://lionbule.iteye.com/blog/717722 http://manpages.ubuntu.com/manpages/oneiric/man8/update-al ...

  10. Update(Stage5):Kudu_javaApi使用_Spark整合

    Table of Contents: 2.3. 安装 Zookeeper 2.4. 安装 Hadoop 2.4. 安装 MySQL 2.5. 安装 Hive 2.6. 安装 Kudu 2.7. 安装 ...

随机推荐

  1. MapReduce-PRODUCTION-DEMAND

    [粗暴的HIVE-SQL]select xyz from abc where ty='sdk' and ret_code=0 and data_source_type=1 and dt between ...

  2. shell实现mysql热备份

    #!/bin/bash #my.hc.sh PATH=/usr/local/sbin:/usr/bin:/bin BACKDIR = /backup/mysql ROOTPASS = ******** ...

  3. CSS浏览器兼容性问题解决方法总结

    CSS浏览器兼容解决总结如下: 1. CSS中几种浏览器对不同关键字的支持,可进行浏览器兼容性重复定义 !important 可被FireFox和IE7识别 * 可被IE6.IE7识别 _ 可被IE6 ...

  4. ABAP 性能优化001

    红方框里那一步之行很慢,lt_iflos这个内表才200多条数据 1.关键是你from那个表有多少数据.... 注意点: 1.不要用 CORRESPONDING FIELDS OF 2.LT_IFLO ...

  5. 采集练习(十) php 获得电视节目预告---数据来自搜视网

    前几天逛湖南卫视,偶然间发现它的网站上也有节目预告,一看源码,居然是来自搜视网的xml,于是就想获得它的数据(页面直接ajax加载估计会有跨域问题) 前阵子也写过另一个方法获得 节目预告(采集练习(七 ...

  6. centos下安装wordpress

    https://www.jianshu.com/p/2439dc2187b2 https://blog.csdn.net/liuhelong/article/details/79924014

  7. Linux内核--并发【转】

    本文转自自:http://www.jianshu.com/p/035550ae05d2 为什么会产生并发 1.多个用户同时登陆的时候,他们有可能在任何时刻以任意的组合调用内核代码. 2.smp系统可能 ...

  8. openstack制作镜像官网地址

    http://docs.ocselected.org/openstack-manuals/kilo/image-guide/content/ch_creating_images_automatical ...

  9. 截取带HTML标签的文本并保留文本样式

    一个截取HTML文本的工具,可以按照文字字数或文字字节长度进行截取,保留HTML样式并在最后自动补齐截取后的标签.按工作要求编写,时间紧迫,代码未优化,欢迎讨论和指正.​1. [文件] SubHtml ...

  10. BZOJ 1651 [Usaco2006 Feb]Stall Reservations 专用牛棚:优先队列【线段最大重叠层数】

    题目链接:http://www.lydsy.com/JudgeOnline/problem.php?id=1651 题意: 给你n个线段[a,b],问你这些线段重叠最多的地方有几层. 题解: 先将线段 ...