Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've installed Oracle Java 7 according to this guide. When I run sudo update-java-alternatives -s java-7-oracle, it gives me :

update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.
update-alternatives: error: alternative /usr/lib/jvm/java-7-oracle/jre/bin/jexec for jexec not registered, not setting.
update-alternatives: error: alternative /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so for mozilla-javaplugin.so not registered, not setting.
update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so.

What is the matter? I use ubuntu12.04 amd64.

share|improve this question
    
Ignore those errors, everything will still work. –  Alin Andrei Mar 11 '13 at 17:15

1 Answer 1

Properly installing Oracle java 7 JDK and JRE on Ubuntu 64Bits and beased distributions.

Properly installing Oracle java 7 JDK and JRE on Ubuntu 64Bits and beased distributions.

OPTION 1: Step by Step

OPEN A TERMINAL WINDOW (uxterm or any other terminal emulator)

Run as root

sudo -i

cd /

Guarantee that command "apt-add-repository" is working (a know bug in some Ubuntu 64bits, and based distributions)

aptitude update

aptitude install python-software-properties

Install Oracle java PPA

apt-add-repository ppa:webupd8team/java

Install Oracle java

aptitude update

aptitude install oracle-java7-jdk oracle-java7-set-default oracle-java7-installer oracle-java7-plugin

Fix know Oracle java issues: part 1. Make the dir "/usr/lib/xulrunner-addons/plugins/"

mkdir -p /usr/lib/xulrunner-addons/plugins

Fix know Oracle java issues: part 2. Register missing alternatives

update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so 1

update-alternatives --set mozilla-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so

update-alternatives --install /usr/lib/xulrunner-addons/plugins/libjavaplugin.so xulrunner-1.9-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so 1

update-alternatives --set xulrunner-1.9-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so

Fix know Oracle java issues: part 3. Correct the location of the "jexec" file in "/usr/lib/jvm/.java-7-oracle.jinfo"

sed -i 's@jre jexec /usr/lib/jvm/java-7-oracle/jre/bin/jexec@jre jexec /usr/lib/jvm/java-7-oracle/jre/lib/jexec@g' /usr/lib/jvm/.java-7-oracle.jinfo

Update java alternatives to make Oracle java to be the default java on system

update-java-alternatives -s java-7-oracle

Uninstall OpenJDK java files

aptitude purge openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib default-jre default-jre-headless icedtea-7-jre-jamvm

Logout from "root" user

exit

Close terminal window

exit

OPTION 2: ONE TIME SCRIPT

OPEN A TERMINAL WINDOW (uxterm or any other terminal emulator)

sudo -i

cd /

aptitude update

aptitude install python-software-properties

apt-add-repository ppa:webupd8team/java

aptitude update

aptitude install oracle-java7-jdk oracle-java7-set-default oracle-java7-installer oracle-java7-plugin

mkdir -p /usr/lib/xulrunner-addons/plugins

update-alternatives --install /usr/lib/mozilla/plugins/libjavaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so 1

update-alternatives --set mozilla-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so

update-alternatives --install /usr/lib/xulrunner-addons/plugins/libjavaplugin.so xulrunner-1.9-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so 1

update-alternatives --set xulrunner-1.9-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so

sed -i 's@jre jexec /usr/lib/jvm/java-7-oracle/jre/bin/jexec@jre jexec /usr/lib/jvm/java-7-oracle/jre/lib/jexec@g' /usr/lib/jvm/.java-7-oracle.jinfo

update-java-alternatives -s java-7-oracle

aptitude purge openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib default-jre default-jre-headless icedtea-7-jre-jamvm

exit

exit
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.