简体   繁体   中英

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM