Installing Official Java on Debian

First of all whenever possible I would recommend using a free alternative like (classpath, kaffe or gcj) but sometimes this is simply not possible because some features are not yet implemented. Since there are no official Sun Java package in Debian, we have to install it from another source or manually. As always there are different ways to accomplish this, we could for example simply fetch the *.bin file from the Sun page, make it executable and let it extract it’s content to /usr/local. Or try to convert the rpm file into a deb with alien and then installing it with dpkg.

Fortunately, there is another solution, namely java-package which will make our life a bit easier. Here is a short description of the package.

apt-cache show java-package

Description: utility for building Java(TM) 2 related Debian packages
 This package provides the capability to create a debian package from
 a Java(TM) 2 distribution by just running make-jpkg <filename>.
 This program currently works with the following Java(TM) 2 Runtime
 Environments and Development Kits:
  * Sun Microsystems(TM) 1.4 and 1.5 Standard Edition
  * IBM(TM) 1.3, 1.4, and 5.0 Standard Edition
  * Blackdown Java-Linux 1.3 and 1.4 Standard Edition
Tag: langdevel::java

As you can read installing java is as simply as executing one command.

make-jpkg <filename-of-java-package>

This simplified my process of installing standard java hope it will help you too.