Oracle java7 config

Solution 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