• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Setting up Tomcat with eclipse anf CATALINA_HOME setup

 
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1) I have downloaded Apache Tomcat zip file in "C:\Users\nirjari\Desktop\Apache Tomcat\" When I extracted files from it , new dir structure where binary and lib files are is
"C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43\lib"

Then I clicked on WIndows Service Installer and Tomcat got installed in "C:\Program Files\Apache Software Foundation\". what should be CATALINA_HOME ?

2) Is it required to download Apache Tomcat zip file (8 MB size) OR can I directly use Windows Service Installer from ''https://tomcat.apache.org/download-60.cgi" website to install Tomcat without downloading it ?

When I am trying to setup eclipse wuth Tomcat Installation Dir as "C:\Program Files\Apache Software Foundation\Tomcat 6.0\lib" OR "C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43\lib", I ma getting error message "The Tomcat installation directory is not valid. It is missing expected file or folder lib/jasper-el.jar" While jasper~el jar is available in both locations.

Why am I getting such an error ? How do I set up correct path here ?

3) I have setup CATALINA_HOME as "C:\Program Files\Apache Software Foundation"
Then I am trying to check version of Tomcat as

"C:\Users\nirjari>"Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43\bin\version.bat"
The CATALINA_HOME environment variable is not defined correctlyThis environment variable is needed to run this program


I don't see version.bat in Tomcat Installation path "C:\Program Files\Apache Software Foundation\Tomcat 6.0\bin"

Then I also tried setting CATALINA_HOME as "C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.4", "C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64" AND "C:\Users\nirjari\Desktop\Apache Tomcat", But I am getting same error.

So whats wrong with CATALINA_HOME in here ? What should be correct CATlALINA_HOME ?
 
Sheriff
Posts: 22781
131
Eclipse IDE Spring VI Editor Chrome Java Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
First of all, why are you using Tomcat 6? You should use the latest version, which is Tomcat 8.


1) Why are you installing Tomcat twice? You can either use the zip file, or use the installer. Using both is not necessary.

2) Remove the "\lib" part from the path. The Tomcat installation directory is "C:\Program Files\Apache Software Foundation\Tomcat 6.0" or "C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43".

3) CATALINA_HOME should be "C:\Program Files\Apache Software Foundation\Tomcat 6.0" or "C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43".
 
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
CATALINA_HOME and CATALINA_BASE are environment variables that point to the sharable and per-instance files used by Tomcat. For single-instance Tomcat use, CATALINA_HOME and CATALINA_BASE normally point to the same place, which is the root Tomcat directory. So, for example, "/home/timh/apache-tomcat-7.0.20" might be the directory created when I unzipped an apache-tomcat-7.0.20.zip file. CATALINA_HOME would therefore be set to /home/timh/apache-tomcat-7.0.20. Adjust values as required.


To run Tomcat, CATALINA_HOME and JAVA_HOME are the basic requirements, with other environment variables getting their default settting from those two. JAVA_HOME, of course, points to the root directory of whichever specific version of Java that you want to run Tomcat under.

When using Tomcat with a JEE plugin such as WTP, you have to configure the plugin to serve in the role of environment, so use the WIndow/Preferences menu to set the Tomcat options as needed.
 
nirjari patel
Ranch Hand
Posts: 386
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I set up CATALINA_HOME and JAVA_HOME correctly. I am not getting these errors anymore.
When I start Tomcat on cmd prompt as below, in the cmd prompt script is running without any error. Below is output od startup.bat at cmd prompt

C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43\bin>startup.bat
Using CATALINA_BASE: "C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43"
Using CATALINA_HOME: "C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43"
Using CATALINA_TMPDIR: "C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43\temp"
Using JRE_HOME: "C:\Program Files\Java\jdk1.7.0_79"
Using CLASSPATH: "C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43\bin\bootstrap.jar"
C:\Users\nirjari\Desktop\Apache Tomcat\apache-tomcat-6.0.43-windows-x64\apache-tomcat-6.0.43\bin>


Is this successful starting of Tomcat ? If not, then why is service not staring. If service is started succesfully, then how come in services.msc, Apache Tomcat service is not started.

Same thing happens with eclipse. When I start Tomcat server from eclipse, it starts succesfully (Mesage comes up). But when I check services, tomcat is not started.

Why is that ? Should Tomcat service not be started whichever way I start it ?

How do I debug this ?

Thanks
 
Tim Holloway
Saloon Keeper
Posts: 27752
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If by "Tomcat service", you mean that you expect Tomcat to show as a running Windows Service when you start it from the command line, no.

The only way that Tomcat will show up in the Windows Services is if it was launched by the Windows Services.

Otherwise, it's just an ordinary Java application, no different from any other Windows application.
reply
    Bookmark Topic Watch Topic
  • New Topic