wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Error on using Tomcat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Error on using Tomcat " Watch "Error on using Tomcat " New topic

Error on using Tomcat

Paul Yoon

Joined: Apr 16, 2012
Posts: 2
Hello all,

Linux noob needs help from gurus.
I appreciate any help in advance.

I got following message when I tried to run startup.sh

This file is needed to run this program

.profile and

export JAVA_HOME=/usr/bin/java
export CATALINA_HOME=/project/wow/apps/apache-tomcat-7.0.26


setenv JAVA_HOME "/usr/bin/java"
setenv TOMCAT_HOME "/project/wow/apps/apache-tomcat-7.0.26"
setenv CATALINA_HOME "/project/wow/apps/apache-tomcat-7.0.26"

when I do 'echo' command like this

I got folling result


but when I tried to 'cd' or 'ls' $CATALINA_HOME,
I got following message

: No such file or directorywow/apps/apache-tomcat-7.0.26

If anyone knows what is wrong, please help me~.
Thank you so much in advance.


Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15947

You are setting JAVA_HOME incorrectly, pointing it to the Java executable.

Set JAVA_HOME to point to the JDK directory, instead. For example, using the common convention for the RPM-based install, the following would work:

Note that the open-source Java that comes with many Linux distros is not full-featured enough to run J2EE. For that, you must have downloaded and installed a commercial-grade JDK (NOT JRE!) such as the one from Oracle or IBM's J9 JVM.

Customer surveys are for companies who didn't pay proper attention to begin with.
Paul Yoon

Joined: Apr 16, 2012
Posts: 2
Thank you for quick answer!

I try to find java directory using 'which java' and it returns /usr/bin/java
I am not the root of the system and I don't know which one to use.
Is there better way to find java directory?
Thank you so much in advance.

Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15947

The "which" command doesn't know anything about how Java SDKs and JDKs are organized. "which" simply searches the current binary PATH for the named program and returns the filesystem location of the copy of that program that would be executed when you type its unqualified name in on the command line.

You definitely don't want to use "which" for J2EE, since it will almost certainly return the location of the open-source Java executable program name. Which not only isn't useful for JAVA_HOME, but that entire Java program is useless for J2EE.

You can find installed JDKs and JVMs by using the "locate" command, which scans a database of file locations that's usually updated once per day. If you do something like "locate jhat", it should return a list of one or more paths where the jhat program is located, and since (in my system at least), the jhat program isn't part of the built-in java, that will guide you to the location of the installed JDKs.

So, for example:

Ignore the details, just look at the directories. You can see that the directories that contain bin/jhat here is "/usr/java/jdk1.6.0_02/", "/usr/java/jdk1.6.0_10", and "/usr/java/jdk1.6.0_13". That's because I have 3 different jdk's installed on that particular machine. Set JAVA_HOME to point to one of them. If you want the latest and greatest, then, you'd set "JAVA_HOME=/usr/java/jdk1.6.0_13".

You may not get any results back on the locate. In that case, no suitable jdk has been installed on the system and you'll have to get your system administrator to download and install one. Just to repeat: the "java" command that came with the OS is not capable of running Tomcat. You must use a "real" JDK". Also, it must be a JDK and not a JRE.
It is sorta covered in the JavaRanch Style Guide.
subject: Error on using Tomcat
Similar Threads
Need help with Tomcat on OSX...
classnotfound Java->mysql jdbc problem!
Need Help starting Tomcat
How to install tomcat5 in Ubuntu 11.04 when it is not in the apt-cache?