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. 搭建SVN服务器详细教程

    搭建SVN服务器详细教程 本教程会从最基本的下载安装到上传代码,下载代码这条线来详细讲述如何完成SVN服务器的搭建 下载并安装VisualSVN server 下载并安装TortoiseSVN 导入项 ...

  2. 性能测试--yslow

    YSlow YSlow可以对网站的页面进行分析,并告诉你为了提高网站性能,如何基于某些规则而进行优化. YSlow可以分析任何网站,并为每一个规则产生一个整体报告,如果页面可以进行优化,则YSlow会 ...

  3. 题解 CF97C 【Winning Strategy】

    题解 CF97C [Winning Strategy] 此题是某平台%你赛原题,跟大家分享一下某校zsy和sxr等同学的神仙做法. 我解释一下题意,大是说,我有[无限]个人,每个人可以对他" ...

  4. Mac环境,React native错误解决方案

    运行react-native run-android,报错如下图:     运行react-native run-ios正常,但 react-native run-android时,提示错误: 在网上 ...

  5. 扫盲--.net 程序集

    前言:用了几天的时间把高级编程里面程序集一章看完了,原来自己只知道写代码,右键添加引用,从来也不知道操作的实质是什么,微软总是这个套路,鼠标点点就能把任务完成,这对新手友好但是对要通透了解程序执行和内 ...

  6. windows下python安装face_recognition模块

    安装face_recognition出现报错,要先安装dlib 安装dlib时报错,要先安装cmake cmake安装成功后,用pip安装dlib失败 从pypi下载dlib的wheel文件,然后用w ...

  7. Swift 烧脑体操(四) - map 和 flatMap

    前言 Swift 其实比 Objective-C 复杂很多,相对于出生于上世纪 80 年代的 Objective-C 来说,Swift 融入了大量新特性.这也使得我们学习掌握这门语言变得相对来说更加困 ...

  8. appium-andriod自动化实现注意项

    注意项: 1.appium需要全局安装,否则run test case 报错“appium not installed” 2.启动appium命令 node /Applications/Appium. ...

  9. Linux tomcat安装详解

    一.tomcat安装 1.下载JDK和Tomcat //通过wget下载 wget http://mirrors.tuna.tsinghua.edu.cn/apache/tomcat/tomcat-8 ...

  10. Warning: Cannot send session cookie – headers already sent…

    相信大多数人在写PHP代码的时候,都遇到过类似 "Warning: Cannot send session cookie – headers already sent…“或者”Cannot ...