Ho installato Oracle Java 7 secondo questa guida.
Quando eseguo sudo update-java-alternatives -s java-7-oracle
, mi dà :
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.
Qual è il problema?
Uso ubuntu12.04 amd64.
Risposta accettata:
Properly installing Oracle java 7 JDK and JRE on Ubuntu 64Bits and beased distributions.
Installazione corretta di Oracle java 7 JDK e JRE su Ubuntu 64Bit e distribuzioni basate su beased.
OPZIONE 1:Passo dopo passo
APRI UNA FINESTRA DI TERMINALE (uxterm o qualsiasi altro emulatore di terminale)
Esegui come root
sudo -i
cd /
Garantire che il comando "apt-add-repository" funzioni (un bug noto in alcune distribuzioni Ubuntu a 64 bit e basate)
aptitude update
aptitude install python-software-properties
Installa Oracle Java PPA
apt-add-repository ppa:webupd8team/java
Installa Oracle Java
aptitude update
aptitude install oracle-java7-jdk oracle-java7-set-default oracle-java7-installer oracle-java7-plugin
Risolvi i problemi di Oracle Java:parte 1. Crea la directory “/usr/lib/xulrunner-addons/plugins/”
mkdir -p /usr/lib/xulrunner-addons/plugins
Risolvi i problemi di Oracle Java:parte 2. Registra le alternative mancanti
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
Risolvi i problemi di Oracle Java:parte 3. Correggi la posizione del file "jexec" in "/usr/lib/jvm/.java-7-oracle.jinfo"
sed -i '[email protected] jexec /usr/lib/jvm/java-7-oracle/jre/bin/[email protected] jexec /usr/lib/jvm/java-7-oracle/jre/lib/[email protected]' /usr/lib/jvm/.java-7-oracle.jinfo
Aggiorna le alternative java per fare in modo che Oracle java sia il java predefinito sul sistema
update-java-alternatives -s java-7-oracle
Disinstalla i file java OpenJDK
aptitude purge openjdk-7-jre openjdk-7-jre-headless openjdk-7-jre-lib default-jre default-jre-headless icedtea-7-jre-jamvm
Esci da utente "root"
exit
Chiudi la finestra del terminale
exit
OPZIONE 2:SCRIPT UNA VOLTA
APRI UNA FINESTRA DI TERMINALE (uxterm o qualsiasi altro emulatore di terminale)
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 '[email protected] jexec /usr/lib/jvm/java-7-oracle/jre/bin/[email protected] jexec /usr/lib/jvm/java-7-oracle/jre/lib/[email protected]' /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