2

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%".

Sančiezz
  • 81
  • 2
  • 11
  • 2
    possible duplicate of [tomcat - CATALINA\_BASE and CATALINA\_HOME variables](http://stackoverflow.com/questions/3090398/tomcat-catalina-base-and-catalina-home-variables) – kenorb Aug 31 '15 at 16:10
  • Just try this link http://www.c-sharpcorner.com/UploadFile/fd0172/how-to-configure-and-install-apache-tomcat-server-in-windows/ , http://www.ntu.edu.sg/home/ehchua/programming/howto/Tomcat_HowTo.html – SaviNuclear Aug 31 '15 at 16:45
  • Thank you SaviNuclear for ntu.edu.sg/.... link, I've found there interesting information about servlets creation. – Sančiezz Aug 31 '15 at 17:51

1 Answers1

1

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.

Thomas Junk
  • 5,588
  • 2
  • 30
  • 43