How to set CATALINA_HOME variable in windows 7?
JavaTomcatEnvironment VariablesJava HomeCatalinaJava Problem Overview
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?
Java Solutions
Solution 1 - Java
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;
Solution 2 - Java
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'.
Solution 3 - Java
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:)
Solution 4 - Java
In order to set CATALINA_HOME:
- First, unzip and paste the apache-tomcat-7.1.100 folder in your C:// drive folder.
NOTE: Do not place your apache tomcat folder within any other folder or drive, place it directly in C:// drive folder only. (I did this mistake and none of the above-mentioned solutions were working).
-
Open environment variable dialog box (windows key+ pause-break key --> advanced setting).
-
Add a new variable name as "CATALINA_HOME" and add the variable path as "C://apache-tomcat-7.1.100"(as in my case), in System Variables.
-
Edit PATH variable name add "%CATALINA_HOME%\bin" and press OK.
-
Close the window and it will be saved.
-
Open Command Prompt window and type command- "%CATALINA_HOME%\bin\startup.bat" to run and start the Tomcat server.
-
END!
Solution 5 - Java
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
Solution 6 - Java
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