Troubleshooting Tomcat Startup Issues During Installation on Ubuntu

pathtomcatUbuntu

I installed Java and now added Tomcat. I configured Tomcat, but it is not running.

What I did was add the line:

export JAVA_HOME=/usr/lib/jvm/java-6-sun

as the first non-comment line in the /home/myuser directory. And then I went to the /opt/tomcat/bin directory and ran this command:

./startup.sh

and it said command was not found. Any reason for that? I see the startup.sh script right in that directory when I do an ls command. I use Ubuntu by the way.

Thanks,
Alex

Best Answer

The first thing I would do is type echo $JAVA_HOME as the user that is starting tomcat. Second, it seems you are using the JVM, you need to use the JDK instead. Tomcat needs the tools in the JDK to run properly.

startup.sh actually calls catalina.sh which resides in the same directory. I've always added the variables that tomcat needs at the top of this file to make sure that it is always loaded with the java instance it needs for your app and that can't be accidentally changed by someone.

If you look at the top of catalina.sh it has all the variables you can set. The ones you would be most interested in are:

#   JAVA_HOME       Must point at your Java Development Kit installation.
#                   Required to run the with the "debug" or "javac" argument.
#
#   JRE_HOME        Must point at your Java Development Kit installation.
#                   Defaults to JAVA_HOME if empty.