This page contains information about and links to the shell script update-sun-jre.
The current version of this script is 2.1.11.
Known bugs and issues are listed here.
A shell script to automate the retrieval and installation of the Oracle (Sun) Java Runtime Environment.
In August 2011, Oracle withdrew the licence that enabled Linux distributions like Debian, Ubuntu and Linux Mint to package and distribute the Runtime Environment. Because of this, some recent security updates have not been distributed through the repositories. If you are using version 6u26 or earlier of the Sun Java packages (sun-java6-bin, sun-java6-jre en sun-java6-plugin), you are running a security risk.
You could consider switching to OpenJDK. However, there are Java applications that do not work (well) with that, so you may have to stick with the Oracle/Sun version. In that case you can follow the instructions on this page to get hold of and install the package from http://www.java.com yourself, or you can download and use the script made available here.
Using one of the following methods:
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License or - at your option - any later version.
While the script itself is distributed under the GPL, what you retrieve with it is not. Using the script implies you have read and accepted the Oracle Binary Code License Agreement for the Java SE Platform Products and JavaFX.
This amounts to unpacking a downloaded archive file in a terminal window and executing the script. It has the advantage of being fast and the disadvantage of not properly 'installing' the script. On top of that, a possibly installed (out of date) sun-java6 installation will remain installed on your system, be it more or less invisible. If you choose this option, this is what you do:
sh update-sun-jre.bin -x
sudo ./update-sun-jre -v install
The downloaded package is a tarball (gzip compressed tar file) with a small unpack script tacked to the front (
head -n 26 update-sun-jre.bin to see what that small script looks like). The tarball contains two files: the script itself and another tarball with support files (update-sun-jre-support.tar.gz). You should not unpack that support tarball, but leave it in the same directory as the script.
The repository provides a Debian package with the script and the same support files as in the support tarball. Setting things up is a bit more work, but the script will be properly integrated in your system. 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. The procedure:
deb https://duinsoft.nl/pkg debs all
sudo wget -P /etc/apt/trusted.gpg.d/ https://duinsoft.nl/pkg/duinsoft.key.asc
sudo apt-get update
sudo apt-get install update-sun-jre
Using the script apt-add-repository -available for Ubuntu- is not advisable because that script makes a few incorrect assumptions.
The key server keys.gnupg.net mentioned above is just an example. You can use any reliable key server. If the apt-key command produces an error, try one of the servers from this page.
Of course you can just download the Debian package from the repository with
apt-get download without installing it right away. If you do that and then decide to install the package anyway using dpkg -iB or GDebi, that will also result in a complete installation.
However, there is a chance GDebi will incorrectly claim the installation has failed. This will have been caused by a rather peculiar error reported by dpkg, about not being able to install the package sun-java-jre (which has just been removed). There are no ill effects to the installation of update-sun-jre, but it does look a bit odd...
If you want to remove the script, how you go about it depends on how you installed it. To undo a manual install, execute the command
sudo ./update-sun-jre -v remove
(with the directory containing the script open in a terminal). This will not work if the script was installed using a Debian package. In that case you could use e.g. Synaptic or apt-get (dpkg --remove will not work). You will be offered another Java installation: OpenJDK. If you do not want that, you can start by installling the sun-java6-plugin (if it is still available in the repository). The other sun-java6 packages will tag along and the script package will be removed automatically.