How do I find out Tomcat's home directory from inside a running servlet?

Alessandro A. Garbagnati

When Tomcat is executed (and you can check both tomcat.sh and tomcat.bat in the tomcat's bin directory) the property 'tomcat.home' is set using -D. This means that you should be able to access it using System.getProperty("tomcat.home").