I recently had to move a project off of Google App Engine. To my surprise, Google App Engines performance was just not fast enough for this project.
In any case, this lead to my installation of Tomcat on OSX and integrating into Eclipse so here is how to do it:
- Get the latest tomcat: http://tomcat.apache.org/index.html. You need to make sure you get the tar or zip file.
- Move the download to /usr/local/.
- Start a super shell:
- If you downloaded the tar, you may have noticed the warning that it will not work with OSX tar command, so make sure to use gnutar which comes with OSX.
- Now you can change owner ship on this new folder so you can start and stop tomcat without having to sudo, but I left it as is.
- Create a link to the folder so that you make your life eaiser in the long term when you install newer versions:
- Go back to your home folder and create a new script :
- Now you can start and stop tomcat from your home folder
$ sudo sh
$ gnutar xzvf apache-tomcat-6.0.26.tar.gz
$ ln -s apache-tomcat-6.0.26 tomcat
#!/bin/sh
export CATALINA_HOME=/usr/local/tomcat
export JAVA_HOM=/usr
if [ "$1" == "start" ] ; then
$CATALINA_HOME/bin/startup.sh
else
$CATALINA_HOME/bin/shutdown.sh
fi
$ sudo ./tomcat.sh start <== To start
$ sudo ./tomcat.sh <== To stop
Now that Tomcat is setup, you need to configure it in Eclipse:
- Go to Eclipse Preferences ->Server -> Runtime Environments
- Click Add and select the right Tomcat Version
- Put in /usr/local/tomcat for the Tomcat Installation directory (the link we created above)
- Click Finish and you should be setup
-
Good Luck!
Leave a Reply