I am working my way through the RUNNING.txt file for installing Tomcat.

It says:

(3.1) Set CATALINA_HOME (required) and CATALINA_BASE (optional)

The CATALINA_HOME environment variable should be set to the location of the
root directory of the "binary" distribution of Tomcat.

So I know I can do

export CATALINA_HOME=/usr/local/tomcat

But that will be gone next time I reboot the machine.

Should I put these in the root accounts .bashrc or .bash_profile or somewhere else?


I am using setenv.sh bash script, which is located in $TOMCAT_HOME/bin directory. catalina.sh script is referring to it by default.

Forgot to mention, that this script is not there by default. You need to create it and give tomcat user (or whatever user you use to run tomcat) to be able to execute it.

  • The docs say: "Apart from CATALINA_HOME and CATALINA_BASE, all environment variables can be specified in the "setenv" script". That would imply that there is somewhere else to put these to me. – wobbily_col Jan 20 '15 at 13:30
  • You are right. I've checked my init script (/etc/init.d/tomcat , made on my own) and I am setting up CATALINA_HOME at the beginning of it. – Piotr Jan 20 '15 at 13:36
  • The docs are kind of confusing. It says in another place that the recommended place to set these is a setenv script. – wobbily_col Jan 20 '15 at 13:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.