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. Upgrading Elasticsearch

    Upgrading Elasticsearch | Elasticsearch Reference [5.6] | Elastic https://www.elastic.co/guide/en/el ...

  2. HDFS relaxes a few POSIX requirements to enable streaming access to file system data

    https://hadoop.apache.org/docs/r2.7.2/hadoop-project-dist/hadoop-hdfs/HdfsDesign.html Introduction [ ...

  3. Hive 实际上对于所存储的文件的完整性以及数据内容是否和表结构一致无支配力

    数据位于hdfs路径下 load data into Table t1 load 执行的是复制文件的操作 create Table partitioned by () 创建了分区目录

  4. LeetCode:安排工作以达到最大收益【455】

    LeetCode:安排工作以达到最大收益[455] 题目描述 有一些工作:difficulty[i] 表示第i个工作的难度,profit[i]表示第i个工作的收益. 现在我们有一些工人.worker[ ...

  5. 序列化组件(get/put/delete接口设计),视图优化组件

    一 . 知识点回顾 1 . 混入类 , 多继承 class Animal(object): def eat(self): print("Eat") def walk(self): ...

  6. 实例化Flask的参数和对app的配置

    Flask 是一个非常灵活且短小精干的web框架 , 那么灵活性从什么地方体现呢? 有一个神奇的东西叫 Flask配置 , 这个东西怎么用呢? 它能给我们带来怎么样的方便呢? 首先展示一下: from ...

  7. Database: coursera assignment 1

    q.1: Find the titles of all movies directed by Steven Spielberg. select title from moviewhere direct ...

  8. linux系统调用mount全过程分析【转】

    本文转载自:https://blog.csdn.net/skyflying2012/article/details/9748133 系统调用本身是软中断,使用系统调用,内核也陷入内核态,异常处理,找到 ...

  9. h5打电话发短信写邮件怎么实现

    // 一.打电话<a href="tel:0755-10086">打电话给:0755-10086</a> // 二.发短信,winphone系统无效< ...

  10. 「洛谷 P1801」黑匣子

    好像很久没有更过博客了,因为博主这几周很忙.其实是在搞颓. 题意很难懂,所以就不重复了.其实是懒. 一眼看上去这是个 \(Splay\) 裸题,直接插入一个数,查询区间第 \(K\) 大,但是这样太不 ...