Error Added to Update Alternatives

I am trying to install jdk for a 32-bit OS. Following the steps below

  • 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

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

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

  • mkdir -p /usr/lib/jvm /usr/bin/java /usr/bin/javac /usr/bin/javaws

  • mv jdk1.6.0_3. / USR / Library / JVM / `

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

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

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

but at runtime cmd 6 I get below the 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. 
+7
source share
4 answers

if you need to install java in Ubuntu, you can try using the following command and you will get oracle-java-installer in your synaptic package manager, click on it and install it.

 sudo add-apt-repository ppa:webupd8team/java 

Repeat the following steps.

  $ wget http://download.oracle.com/otn-pub/java/jdk/6u34-b04/jre-6u34-linux-i586.bin $ chmod u+x jre-6u34-linux-i586.bin $ ./jre-6u34-linux-i586.bin $ sudo mkdir -p /usr/lib/jvm $ sudo mv jre1.6.0_34 /usr/lib/jvm/ $ sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jre1.6.0_34/bin/java" 1 $ sudo update-alternatives --install "/usr/lib/mozilla/plugins/libjavaplugin.so" "mozilla-javaplugin.so" "/usr/lib/jvm/jre1.6.0_34/lib/i386/libnpjp2.so" 1 $ sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jre1.6.0_34/bin/javaws" 1 
+12
source

The problem is that you created a folder called "java" in / usr / bin. Delete the folder from / usr / bin and run the command again.

+3
source

Instead of step 4: 4. mkdir -p /usr/lib/jvm /usr/bin/java /usr/bin/javac /usr/bin/javaws

Just use

$mkdir -p /usr/lib/jvm

and make sure you move the files to usr / lib / jvm, for this use

$mv -v jre1.6.0_34 /usr/lib/jvm/

so that you can see the details, and after installation, change the configuration of java and javaws to:

$update-alternatives --config java

choose from the option similarly,

$update-alternatives --config javaws

this should work if you already have other java installed

+2
source

Delete the java folder from / usr / bin and try again

0
source

All Articles