Saturday, April 23, 2005

Servlets and Applets

Another project that's lurking on my hard disk involves some Java servlets, so I thought I'd try to get that up and running again. The first stop for information was the page on the subject at developer.apple.com, and the first thing to download is a copy of Tomcat 5.5.9. After installing under /usr/local/jakarta-tomcat-5.5.9 and reading the RUNNING.txt file, the first piece of vital extra information is that JAVA_HOME needs to be /Library/Java/Home.

The more serious problem elucidated in the RUNNING.txt file is that tomcat-5.5.9 needs JRE 5.0 or later to run out of the box.

Pause. Actually, the even more serious problem is that the OS 10.3.9 upgrade has killed Java.

~:java -version
Segmentation fault
<click>.
~:java -version
java version "1.4.2_05"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_05-141.4)
Java HotSpot(TM) Client VM (build 1.4.2-38, mixed mode)
Digression over.

So, returning to the fray the jakarta-tomcat-5.5.9-compat.tar.gz gets untarred into /usr/local, and lo a page appears at port 8080.

Some hints from this page also led me to edit conf/tomcat-users.xml to add the roles admin,manager to allow administrative access, which is helpful for seeing how things are getting on.

Now I just need to get my own code compiled and installed. Adding /usr/local/jakarta-tomcat-5.5.9/common/lib/servlet-api.jar to the CLASSPATH takes care of the first, and the second involves following the instructions at the developer.apple.com page.

0 Comments:

Post a Comment

<< Home