Gentoo Wiki


This article is part of the HOWTO series.
Installation Kernel & Hardware Networks Portage Software System X Server Gaming Non-x86 Emulators Misc

This article is still a Stub. You can help Gentoo-Wiki by expanding it.



How to setup Apache Ant and Jakarta Tomcat development environment in gentoo


I assume you already successfuly installed java development environment. If you haven't done so, here is a good Gentoo Java guide from the Gentoo site itself.

What to emerge?

Firstly you need to install tomcat. For newbies like me I would like to suggest to install the documentation too. This will include some good jsp and servlet examples:

USE="doc" emerge tomcat

Next you will need to emerge the Apache Ant:

emerge dev-java/ant

Some little hack

In order for ant to utilize tomcat management utility you have to copy catalina-ant.jar from Tomcat library to Ant library:

cp /opt/tomcat5/server/lib/catalina-ant.jar /usr/share/ant-core/lib

or perform a symbolic link:

cd /usr/share/ant-core/lib
ln -s /opt/tomcat5/server/lib/catalina-ant.jar .

note in this case I'm using tomcat version 5 hence the /opt/tomcat5 path. Substitute that with your tomcat version path

Installing Servlets

This is a quick quick very quick howto. See for details.

Servlets come in source zip files and binary files with a war extension. These are very simple to install, once you know how to do it. To install a binary servlet in tomcat you simply copy the war file into the /opt/tomcat5/webapps directory. You then goto

cp ServletA.war /opt/tomcat5/webapps

The servlet is now available via


Initial Cut by:

Mohammad Jeffry a.k.a linuxlah. Can drop me a message at
Retrieved from ""

Last modified: Thu, 16 Mar 2006 18:14:00 +0000 Hits: 27,861