Tuesday 28 October 2008

Choosing which version of Java JRE system should use

Sometimes a number of various Java Runtime Environment versions is needed to be installed on a Linux system. To chose which one to use as a default use this command:

sudo update-alternatives --config java


An output like this will show up:

There are 6 alternatives which provide `java'.

Selection Alternative
-----------------------------------------------
1 /usr/bin/gij-4.3
2 /usr/lib/jvm/java-gcj/jre/bin/java
3 /usr/lib/jvm/java-6-sun/jre/bin/java
* 4 /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
+ 5 /usr/lib/jvm/java-6-openjdk/jre/bin/java
6 /usr/bin/gij-4.2

Press enter to keep the default[*], or type selection number:


All to do here is enter the number of the selection next to the alternative JRE name and press enter.

Hope this was helpful. Enjoy.

Schedule fsck program to check disks on next reboot

It's not save to run fsck (file system check) while the disks are mounted. But it can be scheduled to run check on the next reboot simply by creating a file named 'forcefsck' on he root partition. Like this:

$ sudo touch /forcefsck