Sun does not allow redistribution of their JRE or SDK. The free VM’s for Java are behind by many versions. For that reason, some work has to be put in to get a usable Java development environment on Debian. I am using Debian Testing (Sarge).
There are two methods to get a Java environment set up: use the Blackdown Debian repository, and roll a .deb with Sun’s SDK.
Blackdown’s Debian repository is a hassle free way to install a Java SDK. The downside is that it lags behind Sun’s official SDK in fixes and features, and the repository is not always available or maintained. You can get information about the repository from www.blackdown.org. Using the repository takes three steps:
deb ftp://ftp.tux.org/java/debian/ sarge non-freeto
aptitude install j2sdk1.4to get the SDK and
aptitude install j2re1.4to get the JRE
Using the latest official release from Sun takes a bit more work, but Debian has made some tools to stream line it a bit:
- Make sure you have “unstable contrib” in
aptitude install java-package
- Download the J2SDK as a binary file from Sun’s web site. Be careful not to get the bin that unpacks into an RPM.
fakeroot make-jpkg <j2sdk package>to make a .deb package containing the SDK.
dpkg -i <SDK.deb>to install the package.
aptitude install sun-j2sdk1.4debianto get the Debian specific components.
That should give you a fully functional Java development environment. You might also want to install ant. I was impressed that Debian took care of installing the Java plugin for Mozilla for me.
Props go to Byron Clark for giving me these instructions.