MEPIS Community Forum

A Linux operating system based on Debian Stable
View unanswered posts | View unsolved topics | View active topics |



Reply to topic  [ 5 posts ] 
How to install the latest version of Oracle JRE on Mepis 11 
Author Message
Forum Novice
Forum  Novice

Joined: Mon Apr 23, 2012 4:48 am
Posts: 19
Has thanked: 12 times
Have thanks: 10 times
Post # 307331
Post How to install the latest version of Oracle JRE on Mepis 11
sun-java6-jre update 26 and openjdk-6-jre update 18 are the last versions of Java runtime environment that show up
in squeeze repositories. openjdk-7-jre is only available for testing and sid, and I have not been able to find a proper
way to install it on Mepis 11/Debian Squeeze.

In my search for a solution, I've come across two different methods to install the latest version of Oracle (Sun) Java
Runtime Environment. The first one is a script called update-sun-jre. Properly installed, it will easily and automatically
download, install and setup the latest version of Oracle Java. This method is simple and it works great, but it has the
disadvantage of only installing Oracle's Java 7. Java 6 end of public updates is extended to February 2013, and I had
read that it was safer than version 7. I searched further and found out another method. This method makes use of
"java-package", a Debian utility for building .deb files from java binary distributions, and it lets you install either JRE7
or JRE6.

After having tried the methods on my system (Mepis 11 32-bit, Firefox 9.0.1), I would say that both are good. If you
are looking for a simple way to install and maintain the latest version of Oracle JRE, go with the first method. If you
are looking for JRE6, go with the second method.


First Method

Notes
1) Source: http://www.duinsoft.nl/packages.php
2) You can remove icedtea6-plugin after installation, but don't remove openjdk-6-jre. LibreOffice 3.4.3 on Mepis 11
doesn't recognize JRE7.

Installation
1) Add the repository and import the gpg key:
su -c 'touch /etc/apt/sources.list.d/oracle-java.list'
su -c 'echo "deb http://www.duinsoft.nl/pkg debs all" > /etc/apt/sources.list.d/oracle-java.list'
su -c 'apt-key adv --keyserver keys.gnupg.net --recv-keys 5CB26B26'

2) To install the script, open Synaptic, click Reload, and then search for and install "update-sun-jre", or run:
su -c 'apt-get update'
su -c 'apt-get install update-sun-jre'

That's it. Now you have installed the latest version of the Oracle Java Runtime Environment. There is no need to
further configure Java with "update-alternatives --config" commands or create a symlink in the Firefox's plugin
directory. To open Java Control Panel open Kickoff and type 'java' in the search box.

Test
1) Open a terminal window, and run "java -version".
2) Start Firefox, type "about:addons" in the address bar, or verify Java installation here.

Upgrade
You will receive updates automatically. Use Synaptic to install the latest version, or run:
su -c 'apt-get update'
su -c 'update-sun-jre -v install'

Note: [-v] means verbose. You can specify other options, like force installation of a 32 bit runtime on a 64 bit
system. Run the following command to get a list of possible options:
su -c 'update-sun-jre -h'

Uninstallation
1) You can use Synaptic and mark the "update-sun-jre" package for complete removal, or run:
su -c 'apt-get purge update-sun-jre unixodbc'
2) To completely remove all traces of the Oracle Java and the script, delete these file and folders:
su -c 'rm -v /etc/apt/sources.list.d/oracle-java.list'
su -c 'rm -r -v /opt/java'
rm -r -v ~/.java



Second Method

Notes
1) Source: java-package: Replacement of sun-java6
2) Like the first method, you can safely remove icedtea6-plugin after installation. When it comes to "openjdk-6-jre"
packages, I haven't actually tried to remove any. I would guess that one could just remove them all, but I am not
sure about the side effects on Mepis. (If you have a backup image of your Mepis partition available, please check it
out and post your findings.)

Important: The commands given below assume building a Debian file from Oracle JRE6 update35 binary package.
You have to replace the paths with the paths on your system and the binary package name (jre-6u35-linux-i586.bin)
with the name of your desired release. (I've tested this with both JRE6 and JRE7 binary distributions and with both
.bin and .tar.gz. binary packages.)

Installation
1) Install fakeroot and the packages that are needed to resolve dependency problems:
su -c 'apt-get install fakeroot debhelper gettext html2text intltool-debian libunistring0 po-debconf'
2) Get the java-package from Debian and the appropriate java binary from Oracle. Save both in your Downloads folder.
3) Run these commands to install java-package, build a Debian file from the java binary and install the .deb package:
cd Downloads
su -c 'dpkg -i java-package_0.50+nmu1_all.deb'
fakeroot make-jpkg jre-6u35-linux-i586.bin
su -c 'dpkg -i oracle-j2re1.6_1.6.0+update35_i386.deb'

4) Create a symlink in the Firefox's plugin directory pointing to the Oracle's Java plugin:
mkdir ~/.mozilla/plugins
cd ~/.mozilla/plugins
su -c 'ln -s /usr/lib/jvm/j2re1.6-oracle/lib/i386/libnpjp2.so'

5) Configure the system so it uses JRE6 instead of OpenJDK6:
su -c 'update-alternatives --config java'
su -c 'update-alternatives --config jexec'
su -c 'update-alternatives --config javaws'

6) LibreOffice > Tools > Options > Java > select the desired java version > OK > restart LibreOffice

Test
1) Open a terminal window, and run "java -version".
2) Start Firefox, type "about:addons" in the address bar, or verify Java installation here.

Upgrade
New upstream releases will not be automatically updated. You need to check for updates manually.

Uninstallation
1) Synaptic > search for and remove "oracle-j2re1.6", or run:
su -c 'apt-get purge oracle-j2re1.6'
2) To remove java-package and other packages you've previously installed, run:
su -c 'apt-get purge java-package fakeroot debhelper gettext html2text intltool-debian libunistring0 po-debconf'
3) Delete Java cache folder and Firefox's plugin directory:
rm -r -v ~/.java
rm -r -v ~/.mozilla/plugins


Last edited by mads65 on Mon Sep 24, 2012 5:23 pm, edited 1 time in total.



Sun Sep 23, 2012 10:19 pm Profile
Forum Veteran
Forum Veteran
User avatar

Joined: Mon Feb 12, 2007 1:45 pm
Posts: 5672
Location: Penn's Woods
Has thanked: 804 times
Have thanks: 662 times
Post # 307340
Post Re: How to install the latest version of Oracle JRE on Mepis
Thanks, mads65. I had previously installed Java 7 on my system, but there was residue on my system from two older Java 6 packages that were never cleaned up. I installed the update-sun-jre package, per Method 1 that you posted, and it automatically removed the two older Java packages. Everything seems to be in order, and my system was tidied up nicely.

I'm looking forward to the next Java release to see how the update works. If it works, it will certainly be a lot easier than the manual method I was using.

You should document these methods in the MEPIS Wiki.

_________________
MX-14; 3.12-0.bpo.1-686-pae kernel using 4GB RAM
2.4GHz AMD Athlon 4600+
NVidia GeForce 6150 LE; 304.121 Display Driver


Mon Sep 24, 2012 9:03 am

joany thanked by: chatan
Profile
Forum Novice
Forum  Novice

Joined: Mon Apr 23, 2012 4:48 am
Posts: 19
Has thanked: 12 times
Have thanks: 10 times
Post # 307354
Post Re: How to install the latest version of Oracle JRE on Mepis
Thank you joany.

Yes, we'll see how the update works when the next Java update comes out in mid October. The script's home page says:
"Additional advantages: a possibly installed out-of-date sun-java6 installation will be removed completely
and if you keep the software source in your list, you will automatically receive updates of the script."

About the Wiki, I don't know. Perhaps one of the admins could add a link to this thread on the Java How-tos page.


Mon Sep 24, 2012 3:19 pm
Profile
Forum Regular
Forum Regular
User avatar

Joined: Fri Oct 17, 2008 8:19 pm
Posts: 798
Location: Okinawa, Japan
Has thanked: 100 times
Have thanks: 142 times
Post # 308224
Post Re: How to install the latest version of Oracle JRE on Mepis
Awesome! Worked great on M11 64-bit Firefox 16

Like Joany, I had previously installed Java 7 on my system, but there was residue on my system from two older Java 6 packages that were never cleaned up. Now now java control panel also has the current version.

I added Method One in the wiki. I'm no expert in Java but hopefully I explained things correctly.
http://www.mepis.org/docs/en/index.php? ... va_How-tos

Cheers


Fri Oct 12, 2012 11:05 pm
Profile
Forum Novice
Forum  Novice

Joined: Mon Apr 23, 2012 4:48 am
Posts: 19
Has thanked: 12 times
Have thanks: 10 times
Post # 308458
Post Re: How to install the latest version of Oracle JRE on Mepis
chatan wrote:
...I added Method One in the wiki. I'm no expert in Java but hopefully I explained things correctly...

I had a look at the Wiki page. Thank you chatan.


Wed Oct 17, 2012 6:11 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Protected by Anti-Spam ACP Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by STSoftware for PTF.