I have downloaded apache-tomcat-7.0.35
. My JDK version is jdk1.6.0_27
.
How do I configure CATALINA_HOME
as an environment variable and how do I run Tomcat server under Windows 7?
The CATALINA_HOME environment variable should be set to the location of the root directory of the "binary" distribution of Tomcat. The Tomcat startup scripts have some logic to set this variable automatically if it is absent, based on the location of the startup script in *nix and on the current directory in Windows.
In environment variables define CATALINA_HOME as a new variable and the value for the variable value assign to >>> C:\apache\apache-tomcat-7.0.40. in the path append this %CATALINA_HOME%\bin to get the command "catalina start" to work. Follow this answer to receive notifications.
By default, CATALINA_HOME is /usr/share/tomcat6 , and CATALINA_BASE is /var/lib/tomcat6 . In either Tomcat6 or Tomcat7 installed with Apt-Get, find the declarations of CATALINA_HOME and CATALINA_BASE, in /etc/init. d/tomcat6 or tomcat7, and EXPORT them to the OS variables.
Setting the JAVA_HOME
, CATALINA_HOME
Environment Variable on Windows
One can do using command prompt:
set JAVA_HOME=C:\ "top level directory of your java install"
set CATALINA_HOME=C:\ "top level directory of your Tomcat install"
set PATH=%PATH%;%JAVA_HOME%\bin;%CATALINA_HOME%\bin
OR you can do the same:
JAVA_HOME
and provide variable value as C:\ "top level directory of your java install"
CATALINA_HOME
and provide variable value as C:\ "top level directory of your Tomcat install"
;%CATALINA_HOME%\bin;
Assuming Java (JDK + JRE) is installed in your system, do the following steps:
C:>echo %path%
C:\Program Files (x86)\Java\jdk1.6.0_27\bin;%CATALINA_HOME%\bin;
C:>echo %classpath%
C:\Program Files (x86)\Java\jdk1.6.0_27\lib\tools.jar; C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\lib\servlet-api.jar;
C:>echo %CATALINA_HOME%
C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0;
C:>echo %JAVA_HOME%
C:\Program Files (x86)\Java\jdk1.6.0_27;
Now you can test whether Tomcat is setup correctly, by typing the following commands in your command prompt:
C:/>javap javax.servlet.ServletException C:/>javap javax.servlet.http.HttpServletRequest
It should show a bunch of classes
Now start Tomcat service by double clicking on 'Tomcat7.exe' under 'C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\bin'.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With