• 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

Tomcat 5.5.23

 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Can somebody direct me to understand Catalina.bat file after opening it by a text editor and reading it
Thanks Varuna
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Varuna, what exactly do you want to know about catalina.bat? It is a Windows batch file. Look for example at this for more info about batch files: Windows XP - Using batch files.

Is there something specific that you want to understand about it?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The catalina.bat is mainly concerned with manipulating some system environment variables - see the list at the start of the bat for the meaning and usage of these variables.

If it does not find a CATALINA_HOME, it makes a guess.

Then it goes on to check for various stuff, and finally executes one of the commands from the command line - see the list of commands.

Yes - it is hard to figure out exactly what it is doing ;) but you can add "echo" lines as needed to show what is being executed.

Bill
 
Varuna Seneviratna
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Help me to Understand what is said below this is an extract of Catalina.bat for Tomcat 5.5.23
<--------------------------------------------------->
rem Guess CATALINA_HOME if not defined
set CURRENT_DIR=%cd%
if not "%CATALINA_HOME%" == "" goto gotHome
set CATALINA_HOME=%CURRENT_DIR%
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
cd ..
set CATALINA_HOME=%cd%
cd %CURRENT_DIR%
:gotHome
if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
echo The CATALINA_HOME environment variable is not defined correctly
echo This environment variable is needed to run this program
goto end
kHome

rem Get standard environment variables
if exist "%CATALINA_HOME%\bin\setenv.bat" call "%CATALINA_HOME%\bin\setenv.bat"
<------------------------------------------------------------------------>

1 What is the Language used to write this batch file?
2 if not "%CATALINA_HOME%" == "" goto gotHome
//What is meant here? ,What is gotHome
// As I can I understand what it says is If CATALINA_HOME is not equal to "" then go to gotHome, Now at this point if CATALINA_HOME is assigned to a value why is it assigned a another value using the statement
set CATALINA_HOME=%CURRENT_DIR% and what is indicated by % sign

3 if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
1 What is meant here?
2 As I get it If the if conditin is true then go to oKHome
//Please explain the syntax if you can and what is oKHome, what is meant by go to
3 In the next line cd.. what is that
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The link provided by Jesper should explain all of that for you.

A forum on Tomcat is not the best place to go over all the details of Windows batch programming.
 
Jesper de Jong
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1 What is the Language used to write this batch file?

Windows batch file control language, see the page where the link in my post above points to.

2 if not "%CATALINA_HOME%" == "" goto gotHome
//What is meant here? ,What is gotHome


It means: If the environment variable CATALINA_HOME does not have no value (so: if it has a value), then jump to the label "gotHome". So "gotHome" is a label. A few lines lower you will see it again, with a colon ":" before it. That's where the control will jump to.

The "set CATALINA_HOME..." statement is executed only if CATALINA_HOME was empty; so that if the user didn't set CATALINA_HOME, then the batch file is guessing what the right value for CATALINA_HOME should be.

The %...% notation is the value of the environment variable.

3 if exist "%CATALINA_HOME%\bin\catalina.bat" goto okHome
1 What is meant here?


If the file "%CATALINA_HOME%\bin\catalina.bat" exists (where %CATALINA_HOME% is ofcourse the value of the environment variable CATALINA_HOME), jump to the label "okHome".

"cd" is a basic command prompt command which changes the current working directory.
[ July 30, 2007: Message edited by: Jesper Young ]
 
Varuna Seneviratna
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Guys
So this is not a Tomcat file at all it is a Windows file which is used to configure Tomcat on the Windows Platform
Varuna
 
Oh. Hi guys! Look at this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic