Apache Tomcat plugin for the asdf version manager, also works with mise.
- Dependencies
- Install
- Supported versions
- CATALINA_HOME
- Configuration
- Upgrading from 1.x
- Contributing
- License
bash,curl,tar: generic POSIX utilities.sha512sum,sha1sum,md5sum(Linux) orshasum,md5(macOS) to verify downloads.- Java, the version depends on the Tomcat version, see Which version do I want?:
| Tomcat | Java |
|---|---|
| 11.0 | 17 or later |
| 10.1 | 11 or later |
| 9.0 | 8 or later |
| 8.5 | 7 or later |
Plugin:
asdf plugin add tomcat
# or
asdf plugin add tomcat https://github.com/asdf-community/asdf-tomcat.gitTomcat:
# Show all installable versions
asdf list all tomcat
# Install the latest version, or the latest 9.0.x
asdf install tomcat latest
asdf install tomcat latest:9
# Set a version for the user (~/.tool-versions) or for the current directory
asdf set -u tomcat latest
asdf set tomcat 9.0.124
# Now catalina.sh is available
catalina.sh version
catalina.sh runWith mise:
mise plugins install tomcat https://github.com/asdf-community/asdf-tomcat.git
mise use tomcat@11Check asdf documentation for more instructions on how to install & manage versions.
Stable releases of Tomcat 6 and later from the Apache archive, new major versions are picked up automatically. Milestones, betas and release candidates are not listed.
Current releases are downloaded from the Apache CDN (dlcdn.apache.org), older ones from the archive.
Every download is verified with the strongest checksum Apache publishes for it (SHA-512, SHA-1 or MD5);
a few very old releases have no checksum and are installed with a warning.
Only catalina.sh is put on PATH: the other scripts in Tomcat's bin directory have generic names
(version.sh, startup.sh, digest.sh) and would clash with other tools.
Use catalina.sh start and catalina.sh stop instead of startup.sh and shutdown.sh.
CATALINA_HOME is set to the selected Tomcat version every time catalina.sh runs.
To get the installation directory elsewhere, e.g. for an IDE:
asdf where tomcat| Variable | Meaning |
|---|---|
ASDF_TOMCAT_MIRROR |
Base URL used instead of https://dlcdn.apache.org/tomcat, the archive stays the fallback |
ASDF_TOMCAT_SKIP_CHECKSUM |
Any non-empty value skips checksum verification, e.g. for a mirror without checksums |
ASDF_TOMCAT_CACHE_TTL |
Seconds to keep the version list in ${XDG_CACHE_HOME:-~/.cache}/asdf-tomcat, 3600 by default, 0 disables |
The version list is cached because asdf asks for it on every asdf latest, asdf list all and asdf install,
and the Apache archive is slow and rate limited. A new Tomcat release shows up within an hour.
- Versions installed by 1.x keep all scripts of
binonPATH. Reinstall them to switch tocatalina.shonly. set-catalina-home.shdoes nothing now and can be removed from the shell profile. It exportedCATALINA_HOMEonce at shell startup, and after switching to another Tomcat versioncatalina.shkept starting the old one.
Contributions of any kind welcome! See the contributing guide.
Thanks goes to these contributors!
See LICENSE © Maxim Butov