Search:  
Gentoo Wiki

HOWTO_Apache_Ant_and_Jakarta_Tomcat

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.

Contents

Background

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

Assumption

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 http://tomcat.apache.org/ 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 http://youserver.foo:8080/servlet/

cp ServletA.war /opt/tomcat5/webapps

The servlet is now available via http://yourserver.foo:8080/ServletA/



Author

Initial Cut by:

Mohammad Jeffry a.k.a linuxlah. Can drop me a message at www.mygentoo.cjb.net
Retrieved from "http://www.gentoo-wiki.info/HOWTO_Apache_Ant_and_Jakarta_Tomcat"

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