Once you've completed all of the above, you should be able to build a working Tomcat
just by running the ant
command in the top level of the
Tomcat source tree. Before you do that, though, you need to set your Ant Java heap to a
larger size than the default so that the build does not fail due to lack of
memory:
$ export ANT_OPTS="-Xms1024M -Xmx1024M"
Then, you're ready to build Tomcat:
$cd
tc6.0.15
$ant
If this process finds everything it needs, you should have a successful build. In only a minute or less (usually), you should have a shiny, brand new Tomcat server.
If you get an error message instead, you have to decide if it is a library compatibility issue or a genuine compilation error, and fix it. Usually, it's just a matter of providing the right versions of the right libraries and the right version of Java that will allow Tomcat to compile. If you really, truly fix an error in Tomcat, please feed it back to the developers via the mailing list (see Chapter 11 for details).
Once you get the BUILD SUCCESSFUL
message, you have a
nearly complete Tomcat distribution in the output/build subdirectory of
your source tree. In order for it to run, it needs a logs directory and a work directory,
plus the scripts in the bin/ directory need to be marked executable. To
finish the build and create release archives of your Tomcat, run the release target in the
dist.xml build file, like this:
$ ant -f dist.xml
This will create a distribution-ready build of Tomcat in the output/dist directory and binary release archive files of Tomcat, the standalone deployer, and the docs, plus a source snapshot archive. All of the archive files will be in the output/release/v6.0-snapshot directory:
$ find output/release/
output/release/
output/release/v6.0-snapshot
output/release/v6.0-snapshot/bin
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot-deployer.tar.gz.md5
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot-fulldocs.tar.gz.md5
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot.zip.md5
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot.zip
output/release/v6.0-snapshot/bin/README.html
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot-fulldocs.tar.gz
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot-deployer.zip.md5
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot-deployer.zip
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot.tar.gz.md5
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot-deployer.tar.gz
output/release/v6.0-snapshot/bin/apache-tomcat-6.0-snapshot.tar.gz
output/release/v6.0-snapshot/KEYS
output/release/v6.0-snapshot/README.html
output/release/v6.0-snapshot/src
output/release/v6.0-snapshot/src/apache-tomcat-6.0-snapshot-src.zip.md5
output/release/v6.0-snapshot/src/apache-tomcat-6.0-snapshot-src.tar.gz
output/release/v6.0-snapshot/src/apache-tomcat-6.0-snapshot-src.zip
output/release/v6.0-snapshot/src/apache-tomcat-6.0-snapshot-src.tar.gz.md5
output/release/v6.0-snapshot/RELEASE-NOTES
If you are running on Windows and have the NullSoft installer available and have
indicated this by setting the property execute.installer
in your build.properties file, you can
run the command ant -f dist.xml installer
, which makes
a Windows installer like the one shown in the Windows section of Chapter 1. The NullSoft Installer is free, open source
software available from http://www.nullsoft.com/free/nsis. Once you've
built a distribution or installer, you can install it as discussed in Chapter 1.
Once you're done running the ant -f dist.xml
command,
you should have a complete Tomcat binary distribution in the
jakarta-tomcat-4.0/dist/ directory. Its contents should be the same
as any binary distribution you may download from the Jakarta Tomcat web site. You should be
able to install and run it in the same way. Pat yourself on the back—most developers never
get this far!
18.224.62.105