Sančiezz
Sančiezz

Reputation: 81

%CATALINA_HOME% environment variable for Apache Tomcat 8 on Windows 7

Just today started to study Java web programming, and I have next question:

Do I need to set-up %CATALINA_HOME% environment variable for installed Apache Tomcat 8 server on Windows 7 OS? If yes - then where/in what cases it will be neccessary? (at the same time I understand the role of %CATALINA_BASE%, but it is not actual for me today)

For now I have succesfully working system without this variable on my OS, but in documentation for Tomcat server I often meet usage of "%CATALINA_HOME%".

Upvotes: 2

Views: 5938

Answers (1)

Thomas Junk
Thomas Junk

Reputation: 5676

If you take a look at catalina.bat, you'll find

 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
 :okHome

where the work is done for you, if you haven't done it by yourself.

Upvotes: 1

Related Questions