I need to install Tomcat 6 for a school assignment. I thought the installation process was easy as counting 123, but it turned out to be a few hours long of head scratching. Well, the first start is to setup a few environment variables as required by Tomcat:
export CATALINA_BASE# JAVA_HOME and Path to java, javac
It can be stored in a
setEnv.sh file, and run with
source setEnv.sh to load those variables.
Then when I tried to run
Tomcat with the following command, there was some error with the
The BASEDIR environment variable is not defined correctly
This environment variable is needed to run this program
I wasted a few hours trying to search for solutions on Google, and as when I was about to temporarily give up for dinner, I found an unexpected answer from one of the blogs.
“I need to set all the shell scripts in
$CATALINA_HOME/bin to be executable”
So let’s fix it:
kenno@kampongcham:~$ cd $CATALINA_HOME/bin
kenno@kampongcham:~/bin/apache-tomcat-6.0.13/bin$ chmod +x *.sh
Finally, it’s done. We can now run tomcat without any errors:
Using CATALINA_BASE: /home/kenno/bin/apache-tomcat-6.0.13
Using CATALINA_HOME: /home/kenno/bin/apache-tomcat-6.0.13
Using CATALINA_TMPDIR: /home/kenno/bin/apache-tomcat-6.0.13/temp
Using JRE_HOME: /usr/lib/j2sdk1.6-sun/bin
That’s it folks. When you setup Tomcat on your machine, make sure you specify the correct path to all the variables mentioned above.
Thanks to Michael for the solution: Tomcat 6 on OSX