As many of you have noticed, the Java runtime environment (JRE) is no longer available in backports. After complaining about this (I'm such a pathetic whiner!), I was informed that a utility called java-package could be used to create an appropriate JRE .deb package. I tried it and it worked, so I thought I'd write a quick HOWTO.
It turns out that the java-package package is an extremely handy utility which takes a Java installer file from Sun and repackages it in a .deb file, quickly and painlessly, which can then be installed with dpkg. If it's not already installed on your system, install it:
Code:
sudo aptitude install java-package
java-package depends on another package called fakeroot, which we'll see later. aptitude will install this automatically if need be.
You'll need either the Java SDK (if you want to develop Java apps) or the JRE (if you just want to run existing Java apps). You can get the 5.0 version (which I used, as Azureus seems to want it) here or the 1.4.2 version here. The file you actually want is the Linux "self-extracting file" (in my example, jre-1_5_0_05-linux-i586.bin). Download this to some convenient location, then open a terminal session in that directory.
Now, make sure you're not logged in as root when you do this. You'll get an error if you try this procedure as root. What you're going to do is run the make-jpkg command in a "fake root" environment created by the fakeroot command. This will keep Sun's installer script from messing with your real system configuration (it apparently likes to mess with stuff in /etc). The actual commands are quite simple. First:
Code:
fakeroot make-jpkg jre-1_5_0_05-linux-i586.bin
Replace jre-1_5_0_05-linux-i586.bin with the name of the file you downloaded, if you didn't download the same package I did. Follow the prompts (agree to the license agreement, etc.), you'll see a lot of stuff spew across the screen, and at the end you should have a .deb file.
The first time I tried this, I got a bunch of errors you get like, "dpkg-architecture: warning: Couldn't determine gcc system type, falling back to default (native compilation)." Turns out I didn't have gcc installed at all. sudo aptitude install build-essential will fix that.
The end result is a file which, in my case, was called sun-j2re1.5_1.5.0+update05_i386.deb. So, the next step is to install it:
Code:
sudo dpkg -i sun-j2re1.5_1.5.0+update05_i386.deb
At this point, Java should be installed. You can check it like this:
Code:
$ java -version
java version "1.5.0_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_05-b05)
Java HotSpot(TM) Client VM (build 1.5.0_05-b05, mixed mode, sharing)
And you're done! Now packages that depend on Java, like Azureus, will install correctly. Life is good.
Bookmarks