wood burning stoves 2.0*
The moose likes Tomcat and the fly likes Trouble running tomcat on Ubuntu Linux. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Trouble running tomcat on Ubuntu Linux." Watch "Trouble running tomcat on Ubuntu Linux." New topic
Author

Trouble running tomcat on Ubuntu Linux.

Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Hello there,

Having trouble running tomcat on Ubuntu Linux 7.0.4.

I installed tomcat under:

/home/untz/DevTools/Java/tomcat/apache-tomcat-5.5.25

Created the CATALINA_HOME system environmental variable inside my .profile directory.

When I try to run TOMCAT, this is what I get:



This file (catalina.sh) is obviously located in the right directory...

When I try to run this file, this is what I get:



My CLASSPATH is set as:



What am I possibly doing wrong?

Happy programming,

Unnsse
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14268
    
  21

Look inside the file /home/untz/DevTools/Java/tomcat/apache-tomcat-5.5.25/bin/catalina.sh and find out what it is doing with the BASEDIR variable.

Is CATALINA_HOME set correctly? What do you get if you type:

echo $CATALINA_HOME


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

A quick way to rule out any typos in your environment variable is to use either the cd or ls command:



If neither of those work, you know you've got it wrong.

Also, unless you're trying to run more than one instance of Tomcat from the same codebase, there is no need to explicitly set the CATALINA_HOME environment variable. You only need to set JAVA_HOME or JRE_HOME.
startup.sh will set the CATALINA_HOME variable for you.


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
Jesper & Ben,

Thanks for the responses!

There are not any typos...



Or:



Now, I thought it was a permissions things so inside the bin directory, I conducted a chmod + x *.sh:



When I try to run Tomcat, this is what I get:



Contents of startup.sh:



Contents of setclasspath.sh:



I am getting the BASEDIR problem in both OS X Tiger and Ubuntu 7.0.4...

When I googled, this problem, it seems as if a bunch of people were experiencing this but there was no solutions?!

See the search results (from Google) fficial&client=firefox-a" target="_blank" rel="nofollow">here.

This is really frustrating!

In the past five years, I've never experienced a problem that seems so simple to solve but something that just comes out of the box (when one downloads and unzips Tomcat from http://tomcat.apache.org)!?

With thanks,

Unnsse
Tualha Khan
Ranch Hand

Joined: Nov 22, 2000
Posts: 287
What does the following command print on the console?

env

rgds,
tualha


SCJP2, BEA WLS 6.0, DB2 UDB 7.1
Unnsse Khan
Ranch Hand

Joined: Nov 12, 2001
Posts: 511
I actually got it working...

What it was is that after you set the system environmental variable, you are supposed to start tomcat by manually issuing the entire path, instead of issuing it from $CATALINA_HOME.

So, for example, if $CATALINA_HOME is set to /usr/local/tomcat/

instead of trying to run it from the command line by issuing:

sh $CATALINA_HOME/bin/startup.sh

One should do it manually:

cd /usr/local/tomcat
/usr/local/tomcat $ sh startup.sh

And wa la! You'll see:

Using CATALINA_BASE: /usr/local/tomcat/
Using CATALINA_HOME: /usr/local/tomcat/
Using CATALINA_TMPDIR: /usr/local/tomcat/
Using JRE_HOME:
/System/Library/frameworks/JavaVM.framework/Versions/1.5.0/Home

After doing this once, $CATALINA_HOME works...

Got it working in both Linux and OS X...

Cheers,

Unnsse
[ October 12, 2007: Message edited by: Unnsse Khan ]
Noms Dom
Greenhorn

Joined: Jan 30, 2009
Posts: 5
do chmod +x catalina.sh
chmod +x startup.sh
and same for all .sh files in the tomcat bin dir it will work
Thilina Buddhika
Greenhorn

Joined: Jul 01, 2009
Posts: 1
chmod +x *.sh will do the trick.
See Furst
Greenhorn

Joined: Aug 04, 2010
Posts: 29
Unnsse Khan wrote:Hello there,

Having trouble running tomcat on Ubuntu Linux 7.0.4.

I installed tomcat under:

/home/untz/DevTools/Java/tomcat/apache-tomcat-5.5.25

Created the CATALINA_HOME system environmental variable inside my .profile directory.

When I try to run TOMCAT, this is what I get:



This file (catalina.sh) is obviously located in the right directory...

When I try to run this file, this is what I get:



My CLASSPATH is set as:



What am I possibly doing wrong?

Happy programming,

Unnsse


Hehe I get this:

something in the path is wonky.. but the server seems to start fine.


Doin' Java to be one of the cool kids.
I usually use Perl;
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16140
    
  21

http://www.coderanch.com/how-to/java/DontWakeTheZombies

You are going to confuse everyone. Whatever the original problem was in this thread, it was long enough ago that your problem is not likely to be the same thing.

We do not charge extra for starting your own message thread. In fact, we encourage it!


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Trouble running tomcat on Ubuntu Linux.