Thursday, August 19, 2010

install and test Apache tomcat on windows 7

if you want to a server to host some JSPs and Servelets. Tomcat is one of those popular FREE servers. install and configure it is super easy, I will show you how to install it on windows . basically there are 3 steps.

  • Tomcat is a standard JAVA application, so make sure you install the JDK. Different tomcat version might need least java version. check it here,
  • Download and install the zip file which contains the jars and some resources, as well configurations.
  • kick it manually or add it as  a windows service.

So , first make sure JDK is there, if not, download one jdk from Sun, and click to install it.  After that, Put the JDK bin directory to windows path variable. and Setup JAVA_home to the jdk folder.
   run JAVA –version |JAVAC –version, you will get the following output depends on your version. this means that JDK and PATH is all set.

C:\>java -version | javac -version
java version "1.6.0_21"
Java(TM) SE Runtime Environment (build 1.6.0_21-b06)
Java HotSpot(TM) Client VM (build 17.0-b16, mixed mode, sharing)
javac 1.6.0_21

then, download and unzip the tomcat files here,, since tomcat is a standard java application, there should be the same for 32/64 bit windows. why there are two bits for you to download, they only difference is it hold one specific version of Java service wrapper that enable you to put the java as a windows service.
  unzip it to c:\apache ,the folder should looks like this.


start it manually or Add it as a windows service.
  go to the command prompt, enter “catalina.bat start” or “catanalina.bat run” [start the new process in a new window]

the utility basically startup the java process and put more parameters to load.
  here is mine.

"C:\jdk1.6.0_21\bin\java"   -Djava.util.logging.config.file="C:\apache\conf\" -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager   -Djava.endorsed.dirs="C:\apache\endorsed" -classpath "C:\apache\bin\bootstrap.jar;C:\apache\bin\tomcat-juli.jar" -Dcatalina.base="C:\apache" -Dcatalina.home="C:\apache""C:\apache\temp" org.apache.catalina.startup.Bootstrap  start 

or run “ service.bat install tomcat7” , create a windows service.



the windows service will be called “Apache Tomcat [youservicename]”, tomcat7.exe is the one which differs in 32/64 bit downloads.


jeet said...


DenAcademics said...

rubbish most people have trouble logging on try providing a solution for that.

PoorFranz said...

Tks 100000

Menorca Chaturvedi said...

thankyou!i just had to run cmd as administrator to kill the permission issue!

Locations of visitors to this page