# Trouble getting Tomcat to start up during install

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

-
Can you post the tomcat log or copy/paste the startup output? It might not be startup,sh that can't be found but maybe the path to your shell in the first line in the script is bad? –  mahnsc Apr 5 '11 at 2:41
try . ./startup.sh ? –  JoseK Apr 5 '11 at 6:48

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.

-
Thank you that worked :) –  Genadinik Apr 5 '11 at 17:33