Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error thrown in update-alternatives

Tags:

java

linux

I am trying to install jdk for 32-bit OS. Followed the below steps,

  1. wget --no-cookies --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" http://download.oracle.com/otn-pub/java/jdk/6u38-b05/jdk-6u38-linux-i586.bin

  2. chmod u+x jdk-6u34-linux-i586.bin

  3. ./jdk-6u34-linux-i586.bin

  4. mkdir -p /usr/lib/jvm /usr/bin/java /usr/bin/javac /usr/bin/javaws

  5. mv jdk1.6.0_3./usr/lib/jvm/`

  6. update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.6.0_38/bin/java" 1

  7. update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_38/bin/javac" 1

  8. update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jre1.6.0_38/bin/javaws" 1

but while running cmd 6 i am getting below error. Any help would be appreciated.

update-alternatives: warning: forcing reinstallation of alternative /usr/lib/jvm/jdk1.6.0_38/bin/java because link group java is broken.
update-alternatives: warning: not replacing /usr/bin/java with a link.
update-alternatives: warning: forcing reinstallation of alternative /usr/lib/jvm/jdk1.6.0_38/bin/javac because link group javac is broken.
update-alternatives: warning: not replacing /usr/bin/javac with a link.
update-alternatives: error: alternative path /usr/lib/jvm/jre1.6.0_38/bin/javaws doesn't exist.
like image 247
Linda Avatar asked Jan 30 '13 10:01

Linda


1 Answers

The issue is that you have created a folder named "java" in /usr/bin . Remove the folder from /usr/bin and run the command again.

like image 89
Rahul Avatar answered Oct 15 '22 10:10

Rahul