Wednesday, October 24, 2007

Installing and Running Tomcat on Ubuntu

This link was pretty helpful: http://ubuntuforums.org/showthread.php?t=44006 except that the instructions for installing sun-jre and sun-j2sdk don't work. So of course Tomcat doesn't run.

How to fix? It seemed like java was installed. In fact java -version and javac -help gave good results. But where? It took some digging. I found the update-alternatives helpful. It helped me find where java was REALLY installed. On my system when I do:
$ update-alternatives --display java
I get the following:
java - status is auto.
link currently points to /usr/lib/jvm/java-1.5.0-sun/jre/bin/java
/usr/bin/gij-4.2 - priority 42
slave java.1.gz: /usr/share/man/man1/gij-4.2.1.gz
/usr/lib/jvm/java-1.5.0-sun/jre/bin/java - priority 53
slave java.1.gz: /usr/lib/jvm/java-1.5.0-sun/jre/man/man1/java.1.gz
Current `best' version is /usr/lib/jvm/java-1.5.0-sun/jre/bin/java.

So the trick to getting Tomcat to start per the instructions was to set
$ export JAVA_HOME=/usr/lib/jvm/java-1.5.0-sun

No comments: