crunchbang waldorf – debian wheezy – install java sun/oracle jdk

g3n1k@n43s:~$ sudo apt-get install sun-java6-jdk

g3n1k@n43s:~$ ls /usr/lib/jvm
 default-java                                 java-6-openjdk-amd64      java-7-openjdk-amd64
 java-1.6.0-openjdk-amd64  java-6-openjdk-common   java-7-oracle

# set java default
g3n1k@n43s:~$ sudo update-java-alternatives -s java-7-oracle
 update-alternatives: error: no alternatives for mozilla-javaplugin.so
 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: no alternatives for mozilla-javaplugin.so
 update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so

#fix error after install oracle -jdk7
# fix error update-alternatives: error: no alternatives for mozilla-javaplugin.so
g3n1k@n43s:~$ sudo update-alternatives --install /usr/lib/mozilla/plugins/mozilla-javaplugin.so mozilla-javaplugin.so /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so 1

# fix error update-alternatives: error: no alternatives for xulrunner-1.9-javaplugin.so
g3n1k@n43s:~$ sudo mkdir -p /usr/lib/xulrunner-addons/plugins/
g3n1k@n43s:~$ sudo 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: using /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libnpjp2.so to provide /usr/lib/xulrunner-addons/plugins/libjavaplugin.so (xulrunner-1.9-javaplugin.so) in auto mode

# fix error update-alternatives: error: alternative /usr/lib/jvm/java-7-oracle/jre/bin/jexec for jexec not registered; not setting
g3n1k@n43s:~$ sudo 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

# rerun default
g3n1k@n43s:~$ sudo update-java-alternatives -s java-7-oracle

# check
g3n1k@n43s:~$ sudo update-java-alternatives -l java-7-oracle
 java-7-oracle 1062 /usr/lib/jvm/java-7-oracle

# remove openjdk
g3n1k@n43s:~$ sudo apt-get remove openjdk-6-jre default-jre default-jre-headless
g3n1k@n43s:~$ sudo apt-get autoremove

Published by

G3n1k

just to remember what i had known :)

One thought on “crunchbang waldorf – debian wheezy – install java sun/oracle jdk”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s