Monday, December 27, 2010

Configuring Alternative Packages in Fedora

In this world of multiple Javas and other packages, and Debian created the alternative system to make it easy to pick which implementation of of a package should be selected. Though the man page is helpful Chris Taylor's Wednesday Why gives a succinct explanation of why Fedora adopted this technology.

Most of the time to set up an alternative do the following command:

sudo alternatives --install

For example if I have jdk1.6.0_21 & jdk1.6.0_23 installed and I want to use the latter's compiler I would do,

sudo alternatives --verbose --install /usr/bin/javac javac /usr/java/jdk1.6.0_23/bin/javac 16023

That way if jdk1.60.21's files are untouched by the symlink /usr/bin/javac now points to /usr/java/jdk

From what I have read so far alternatives is a good way of managing symlinks on your system.

Wporta shows how to install and configure Java for a 64 bit system. I might write a bash script to automate this configuration if there is a need. Another good resource is here.

No comments: