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?
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:
- Go to system properties
- Go to environment variables and add a new variable with the name
JAVA_HOME
and provide variable value asC:\ "top level directory of your java install"
- Go to environment variables and add a new variable with the name
CATALINA_HOME
and provide variable value asC:\ "top level directory of your Tomcat install"
- In path variable add a new variable value as
;%CATALINA_HOME%\bin;
Assuming Java (JDK + JRE) is installed in your system, do the following steps:
- Install Tomcat7
- Copy 'tools.jar' from 'C:\Program Files (x86)\Java\jdk1.6.0_27\lib' and paste it under 'C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\lib'.
- Setup paths in your Environment Variables as shown below:
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'.
Here is tutorial how to do that (CATALINA_HOME is path to your Tomcat, so I suppose something like C:/Program Files/Tomcat/
. And for starting server, you need to execute script startup.bat
from command line, this will make it:)
Assuming Java (JDK + JRE) is installed in your system, do the following:
- Install Tomcat7
- Copy 'tools.jar' from 'C:\Program Files (x86)\Java\jdk1.6.0_27\lib' and pasted it under 'C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\lib'.
- Setup paths in your Environment Variables as shown below:
C:/>javap javax.servlet.http.HttpServletRequest
It should show a bunch of classes
There is no requirement of setting CATALINA-HOME.
Follow below instruction .
Right click on computer --> properties --> Advanced system setting --> Environment variables.
User variables section --> click on "New" --> variable name : CLASSPATH , variable value : D:\java\lib*.;D:\tomcat8\lib\servlet-api.jar.; --> Click "Ok"
New --> variable name : PATH , variable value : D:\java\bin; --> Click "Ok"
System variables section:-
Click on "New" --> variable name : PATH , variable value : D:\java\jre --> Click "Ok"
I've installed java and tomcat in D drive henceforth the locations above are under my respective paths.
Give location paths where java and tomcat are installed in your PC. Thank You
来源:https://stackoverflow.com/questions/14579661/how-to-set-catalina-home-variable-in-windows-7