The Official Method
The method briefly outlined in this section was adapted directly from the excellent Java page (http://serios.net/content/debian/java.php) from serios.net, and you should read the page carefully if you run into any problems. I've outlined the quick process, but there is extensive troubleshooting information in the origional page.
In short, Sun's license doesn't allow the redistribution of binary packages (for their own, crazy reasons), so you have to create your own Java package, which is very simple.
Download the Sun Java JRE from the official site (http://java.sun.com/j2se/1.5.0/download.jsp). Yes, it's hard to navigate, but just download the latest version of the JRE, and make sure you get the .bin version, not the .rpm.bin.
Install a couple necessary packages:
# apt-get install java-package fakeroot
Create the .deb archive from the Java .bin package (adjust the filename of the .bin file as appropriate). You must be a normal user for the step, not root:
$ fakeroot make-jpkg jre-1_5_0_01-linux-i586.bin
Install the new package and the Debian-specific files:
# dpkg -i sun-j2re1.5_1.5.0+update01_i386.deb
# apt-get install sun-j2re1.5debian
Running the first command may give you an error, but that's OK, just do the second one. If you are still worried about the error from the first file, you can make sure everything is fixed via:
# apt-get -f install
That's it! Check to make sure everything worked like you expected by checking the -version, which should give you something like:
$ java -version
java version "1.5.0_01"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_01-b08)
Java HotSpot(TM) Client VM (build 1.5.0_01-b08, mixed mode, sharing)
Note that you can copy the java .deb file you created to other machines you own, so you only need to run the last two commands on those boxes. Simplicity itself!
Partager