mamamusings: April 28, 2004

elizabeth lane lawley's thoughts on technology, academia, family, and tangential topics

Wednesday, 28 April 2004

installing tomcat 5 on os x

You’d think there’d be some documentation of this somewhere, wouldn’t you?

Nope. None. Lots on Tomcat 4. None on Tomcat 5. And none that don’t assume some crucial details that I had to bang my head against for a while.

So, for my own reference later (and for the benefit of others who want to do this without having to read a book on the subject), here’s what I ended up doing.

I installed all the XCode 1.1 developer tools for OS X 10.3 (the December 2003 CD). Then I installed the Java 1.42 developer tool update and the Java application server package from the Apple developer site.

The appserver package install gave me Tomcat 4 in the /Library/Tomcat directory, which I then renamed to Tomcat4.

Then I downloaded the latest binary of Tomcat 5 from the Apache Jakarta site.

Following guidelines that I found on developer.com for installing Tomcat 4, I extracted the Tomcat 5 files into a directory in usr/local, and then created a symbolic link to it from the Library directory, like so:

ln -s /usr/local/jakarta-tomcat-5.0.19 /Library/Tomcat

Turns out that when you download and extract the files from the .zip archive, the permissions aren’t set properly to allow execution of the files, so I had to change the permissions on the .bat and .sh files in the /Library/Tomcat/bin directory to allow execution.

chmod 755 /Library/Tomcat/*.sh
chmod 755 /Library/Tomcat/*.bat

When I tried to run Tomcat at this point (/Library/Tomcat/startup.sh), I got an error telling me that JAVA_HOME was not defined. You’d be surprised how hard it is to find out how to fix this seemingly small problem. Several sites told me that I could set JAVA_HOME to /usr, but that was not successful. Then I tried setting it to /Library/Java, but that didn’t work, either. I finally found the solution on SnipSnap.org (although their server wasn’t responding, so I had to use the Google-cached version). Turns out you have to set it to /Library/Java/Home, like so:

setenv JAVA_HOME /Library/Java/Home

Once I’d done that I was able to run startup.sh, and at that point loading http://localhost:8080 successfully brought up the Tomcat 5 home page.

Update, 5/1/04

In order to connect to my mySQL db install using JSP, I downloaded Connector/J 3.0 and installed it using these instructions.

Posted at 1:22 PM | Permalink | Comments (2) | TrackBack (2)
more like this: technology
Liz sipping melange at Cafe Central in Vienna