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 EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Error on using Tomcat " Watch "Error on using Tomcat " New topic
Author

Error on using Tomcat

Paul Yoon
Greenhorn

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

/bin/setclasspath.sh/wow/apps/apache-tomcat-7.0.26
This file is needed to run this program

I set CATALINA_HOME and JAVA_HOME at
.profile and

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

.cshrc

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
echo $JAVA_HOME

I got folling result
/usr/bin/java

echo $CATALINA_HOME
/project/wow/apps/apache-tomcat-7.0.26

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.

Paul




Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15628
    
  15

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
Greenhorn

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.

Paul
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 15628
    
  15

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Error on using Tomcat
 
Similar Threads
classnotfound Java->mysql jdbc problem!
Need help with Tomcat on OSX...
How to install tomcat5 in Ubuntu 11.04 when it is not in the apt-cache?
Need Help starting Tomcat
JAVA_PATH vs. JAVAHOME ??