2.9. Building Tomcat from source


This section will cover what is necessary to build Tomcat from the source files.
Tomcat 5

In order to compile Tomcat 5 from source the following commands will need to be executed in sequence:

cd servletapi/jsr154
export CLASSPATH=servletapi4.jar
ant -Dbuild.compiler=modern dist
cd ../../servletapi/jsr152
ant -Dbuild.compiler=modern dist
cd ../../build
sed -i -e 's:INSTALL_DIR:<install_directory>/jboss-ews-1.0-src/tomcat5:g' build.properties
export CLASSPATH=../servletapi/jsr154/dist/lib/servlet-api.jar:../servletapi/jsr152/dist/lib/jsp-api.jar:../jakarta-taglibs-core.jar:../jakarta-taglibs-standard.jar:../struts.jar:../struts-taglib.jar:../ant.jar:../build/build/server/lib/tomcat-apr.jar
ant -Dbuild.compiler=modern build-jasper-compiler-jdt  release
Tomcat 6

In order to compile Tomcat 6 from source the following command will need to be executed:

ant -Dbase.path="." -Dbuild.compiler="modern" -Dcommons-collections.jar="commons-collections.jar"  -Dcommons-daemon.jar="commons-daemon.jar"  -Dcommons-daemon.jsvc.tar.gz="jsvc.tar.gz"  -Djasper-jdt.jar="jasper-jdt.jar"  -Djdt.jar="jasper-jdt.jar"  -Dtomcat-dbcp.jar="tomcat-dbcp.jar"  -Dtomcat-native.tar.gz=""
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top