HOWTO Apache Ant and Jakarta Tomcat

From Gentoo Linux Wiki

Jump to: navigation, search
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

[edit] Background

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

[edit] 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.

[edit] 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

[edit] 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

[edit] 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/



[edit] Author

Initial Cut by:

Mohammad Jeffry a.k.a linuxlah. Can drop me a message at www.mygentoo.cjb.net
Personal tools