Debian installing Oracle Java

 

These notes are quite old. Yeah. Use common sense when following 🙂

I’m on my Debian testing, installing java as per http://wiki.debian.org/Java didn’t work for me for some reasons.

Edit 2016-06-22: it works these days 🙂 I’ve used new instructions here

 

Web apps I’m forced to use require Sun (well Oracle) version which is no longer supplied by Debian. Bugger.

Most confusing bit (it took me a while to figure out why its’t working…) you need to link to java/lib/i386/libnpjp2.so rather than to java/plugin/i386/ns7/libjavaplugin_oji.so – note, it was for 386, amd64 arch is different I think.

Below notes are for my reference only, no warranty given or implied!

Lets start with random picture from my library, visualisation of my soul after using badly written java program, eeek

insta-18

Go to http://java.com/en/download/ and grab a newest version marked as “Linux (self-extracting file)”, at the time of writing it is jre-8u31-linux-x64.tar.gz

tar -xzf jre-8u31-linux-x64.tar.gz -C /usr/local/
ln -s /usr/local/jre1.8.0_31 /usr/local/java

cd /etc/alternatives/ && for i in firefox-javaplugin.so iceape-javaplugin.so midbrowser-javaplugin.so mozilla-javaplugin.so xulrunner-1.9-javaplugin.so xulrunner-javaplugin.so; do rm $i; ln -s /usr/local/java/lib/amd64/libnpjp2.so $i;done

vi /etc/profile.d/java.sh

PATH=/usr/local/java/bin:$PATH
JAVA_HOME=/usr/local/java
export PATH JAVA_HOME

After next login you should be getting:

java -version

java version "1.8.0_31"
Java(TM) SE Runtime Environment (build 1.8.0_31-b13)
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

Additionally, for system wide access to new java

and Java plugin should be available in Iceweasel

update-alternatives --install /usr/bin/java java /usr/local/java/bin/java 1
update-alternatives --config java
update-alternatives --install /usr/bin/javaws javaws /usr/local/java/bin/javaws 1
update-alternatives --config javaws

Also, Chrome and Iceweasel plugin

update-alternatives --install /usr/local/lib/libnpjp2.so mozilla-javaplugin.so /usr/local/java/lib/amd64/libnpjp2.so 4
update-alternatives --config mozilla-javaplugin.so

Chrome

mkdir /opt/google/chrome/plugins
ln -s /usr/local/java/lib/amd64/libnpjp2.so /opt/google/chrome/plugins/libnpjp2.so

Iceweasel and Firefox

ln -s /usr/local/java/lib/amd64/libnpjp2.so /usr/lib/mozilla/plugins/libnpjp2.so

 

 

 Leave a Reply

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

(required)

(required)