June 2009

Normally we download Sun JDK installation binaries and install them. Then we configure the PATH environment variable to point to our JDK installation. But some times there will be conflicts between the native gcj and Sun JDK. So it is always better to install Sun JDK through debian repositories.

But unfortunately, the Debian repositories have Sun JDK in non-free repositories and do not always have the latest JDK.

So this is how we can install the latest JDK natively on Debian.

Steps to be followed:

1. We have to download the JDK or JRE binaries (a .bin file) appropriate for our architecture.

2. Then we have to create a .deb package from the Sun JDK binaries we have downloaded

*Requirements:

a.Install java-package which will help us to convert the Sun JDK .bin file to a  .deb file installable on Debian.

b. Install fakeroot.

3. Then do as non-root user,

fakeroot make-jpkg <Sun JDK binary filename>

If there is an error like ‘Plugins not found’ or similar errors, it means that the version of the Sun JDK you are trying to install may not be supported by ‘java-package’. Fortunately, there is a work-around for this:

Edit usr/share/java-package/sun-j2sdk.sh like this:

Add the following to that file:

"<Your Sun JDK/JRE bin file name") # SUPPORTED
j2se_version=1.6.0+update<version>${revision}
j2se_expected_min_size=130
found=true
;;

at the end of the list of similar directives for various versions of JDK/JRE and save the file.

Now repeat step 3 and it will not give the ‘Plugins not found error’ and a .deb package will be created with some warnings which you can ignore safely.

4. Then install the .deb file as a root user by the command:

dpkg -i <generated .deb file name>

5. After the JDK is installed, we have to configure the installed Sun JDK as the default JDK. So we use the following commands:

update-alternatives –config java

This command will show a list of Java installations available (including gcj) and prompt for a choice.

Choose the choice which corresponds to your Sun JDK installation. In my case it was something like this:

/usr/lib/j2sdk1.6-sun/bin/java

Now your Sun JDK installation will be the default JDK. 🙂

I have got so used to life with Internet at college that when at home without hi-speed internet connectivity, I feel so uncomfortable. I can’t check emails very frequently, I can’t download stuff, I can’t google and find out answers, I can’t do this and I can’t do that etc.. Life away from the Internet now seems so alien to me and without google I only feel half alive.

When at home I have to go to nearby browsing centers to surf the internet at moderate speeds, whereas at college I have unlimited, free, hi-speed internet round the clock which I am so used to using. Life without Internet seems so different and eerie, but I do realise that I live a more orderly, proper life at home without Internet connectivity than at college.Of course Internet is a great boon and an unlimited reservoir of knowledge and information, but most of the times I am so immersed into the Internet that I spend too little or no time for other essential things.’

Thus, the stay at home is kind of a welcome break for me from the Internet and I do realise now that such breaks are really good for me than bad. So I am shelving my plan to get a broadband Internet connection at home for now, so that home remains home!