Ubuntu Eclipse and Ant without GCJ
Several packages from the Ubuntu repositories install by default gcj (Gnu Java Compiler) which is one of the open source versions of Java. Some of these packages are Eclipse and Ant. But, because many programs do not run correctly using any other java virtual machine other than that of Sun, I want to use the sun-java version.
To do this you have to use the –no-install-recommends option of apt-get, like this:
sudo apt-get –no-install-recommends install ant
Keep in mind that you might want to install the other recommended packages (in my case, ant-optional and libxerces), like this:
sudo apt-get –no-install-recommends install ant ant-optional libxerces
Compared to the download and compile from the ant website method, this method has the advantage that updates to the chosen packages are automatically installed along with the other updates for stuff from your repository. Furthermore, the possibilty of conflicts and dependecy problems is reduced.
Note: This tutorial presumes that you instaled your desired Java VM first. I use the Sun Java VM and compiler so I installed the package sun-java6-jdk:
sudo apt-get install sun-java6-jdk