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 MethodNotes1) Source:
http://www.duinsoft.nl/packages.php2) 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.
Installation1) 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.
Test1) Open a terminal window, and run "
java -version".
2) Start Firefox, type "about:addons" in the address bar, or verify Java installation
here.
UpgradeYou 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'Uninstallation1) 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 ~/.javaSecond MethodNotes1) Source:
java-package: Replacement of sun-java62) 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.)
Installation1) 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
Test1) Open a terminal window, and run "
java -version".
2) Start Firefox, type "about:addons" in the address bar, or verify Java installation
here.
UpgradeNew upstream releases will not be automatically updated. You need to check for updates manually.
Uninstallation1) 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