Thursday 28 June 2012

Setting JAVA_HOME & CATALINA_HOME for running servlet programs using TOMCAT 7(Windows 7)

Download JDK  & Tomcat 7 from here
JDK : http://www.oracle.com/technetwork/java/javase/downloads/index.html

Tomcat 7  : http://tomcat.apache.org/download-70.cgi

install both the software.

After installing
1. Go to My computer's Properties.
2.Go to Advance tag.
3.Select Environment Variables.
4.In User Variables : click new
               add new Variable Name : JAVA_HOME.
                               Variable Value: C:\Program Files\Java\jdk1.7.0_03
(Set path according to your jdk version)
5.Add new variable name : CATALINA_HOME
   Variable Value : C:\tomcat7
Here , I have installed(extracted from the .zip file) in C:\tomcat7 that is why the variable value is
C:\tomcat7 , if you have installed tomcat in Program Files then path would be like
C:\Program Files\Apache-tomcat7..... (i have renamed the folder "Apace-tomcat1...." to simply "tomcat7" in my case.)
(DO NOT INCLUDE SEMICOLONS IN THESE TWO VARIABLE VALUES)
6.Add these both to existing PATH variable as follow.(IF PATH VARIABLE DOESN'T exists then add a new variable named PATH in side the USER VARIABLES , don't mess with SYSTEM variables if  u don't know what you are dealing with.)
PATH=.;%PATH%.;%JAVA_HOME%\bin.;%CATALINA_HOME%\bin;
PATH=(DOT)(SEMICOLON)%PATH%(DOT)(SEMICOLON)%JAVA_HOME%\bin(DOT)(SEMICOLON)%CATALINA_HOME%\bin(SEMICOLON)


And thats it
Open command prompt and type startup
it will open a new Command prompt window for tomcat and last line would be service will start  in 2045ms (something like this not the exact line)
And thats it.... Its configured to run servlet programs.


No comments:

Post a Comment