Tomcat is an open source Java Servlet container developed by the Apache Software Foundation. It is bundled with a very capable Java based Web (HTTP) Server.
Which Java to install ?
Tomcat requires Java to be installed – it is afterall a Java Servlet container. Since Tomcat 5.5 the dependency on the JDK (Java Development Kit) for compilation of JSPs (Java Server Pages) has been removed. The Eclipse JDT Java compiler has been bundled with Tomcat to provide this capability. This means that we just need to install the JRE (Java Runtime Environment).
So its a simple decision then – or is it ?
Java Virtual Machines
From the Oracle Java SE Documentation:
The JDKTM provides one or more implementations of the JavaTM virtual machine (VM):
On platforms typically used for client applications, the JDK comes with a VM implementation called the Java HotSpotTM Client VM (client VM). The client VM is tuned for reducing start-up time and memory footprint. It can be invoked by using the
-clientcommand-line option when launching an application.On all platforms, the JDK comes with an implementation of the Java virtual machine called the Java HotSpot Server VM (server VM). The server VM is designed for maximum program execution speed. It can be invoked by using the
-servercommand-line option when launching an application.
The above documentation and information from other resources on the differences between the Client VM and Server VM suggest that we should be using the Server VM when running Tomcat on a server.
Unfortunately the Server VM is only bundled with the JDK. So we are back to our dependency on the JDK. If you are installing Tomcat on a server and require the optimisations around speed and for long lived processes install the JDK and use the Server VM.
Which Tomcat Binary Distribution ?
Just when you thought it was getting simpler … The Tomcat 6 Downloads page has 6 options for binary distributions.
Pick the 32-bit/64-bit Windows Service Installer option. This distribution is geared towards users planning to launch Tomcat through Windows services and also provides the compiled APR/native library.
Installing
Download and install the Java 6 SE JDK. Remember to install the 64-bit version if you are running on a 64-bit OS. The Tomcat installer will look for a 64-bit Java VM on a 64-bit OS.
Download and install the Tomcat 6.0.29 32-bit/64-bit Windows Service Installer.
Ensure that you select the Service and Native options under the Tomcat component. The Manager application component provides a web based management application.
You will be asked to choose an HTTP connector port for Tomcat and if you chose to install the Manager component you will also be required to configure authentication details for the Manager.

When asked to provide the path to the java virtual machine to use, specify the JRE folder of the installed JDK.

When the install is complete, the Tomcat service will be automatically started if you chose Run Apache Tomcat in the final screen on the install wizard.
Confirm the install
Once the service has started, the Tomcat icon should appear in the taskbar. Right click the icon and select Configure from the menu.
Select the Java tab on the Apache Tomcat 6 Properties window. Confirm that the Server VM (jre6\bin\server\jvm.dll) is being used by Tomcat.
Open the Windows Services manager and confirm that the Tomcat service has been correctly installed.

Finally confirm that you can communicate with Tomcat on the configured HTTP port. Open http://localhost:8080 in your browser.

Hello,
How to install tomcat 6 on windows 7, I don’t found how to do it
Thanks
Not sure what you mean ? Does the post not cover what you need to install tomcat 6 on windows 7 ?
Thank you for your reply,
I downloaded Tomcat 6.0.29, then I extracted it in a folder, after that I does not found an exe file that permit me to install it,
I double clicked on file catalina (under bin), also the file startup (under bin) but it does not work,
I haven’t an exe file that permit me to launch the installation
Thanks
Make sure you download the “32-bit/64-bit Windows Service Installer” (apache-tomcat-6.0.29.exe) under the “Binary Distributions” section on the download page: http://tomcat.apache.org/download-60.cgi. Sounds like you downloaded one of the zip files.
I forget to notice that in the run of windows 7, it shows a msgBox that says:
Unable to open service topmcat6
Have you any idea about this
Thanks
@Anis – have a look at my latest post – The case of the annoying Tomcat 6 Monitor. It should explain how to resolve your issue.
http://blog.paulbouwer.com/2010/10/23/the-case-of-the-annoying-tomcat-6-monitor/
Run it as an administrator
thank you . your post was very useful
Thanks a lot your post was very usefull….??
However i have a new problem when i click on “configure tomcat” in All programs to start/stop the server my screen resolution changes… same repeats even when i click on “monitor tomcat”.
Thanks Paul Bouwer. This was very useful information.
when i clicked the config/monitor tomcat in Allprogrames it shows access is denied.
i am using tomcat6.0.32 and jdk6 in my windows7
Check out my post The case of the annoying Tomcat 6 Monitor.
You need to ensure that you run the monitor as Administrator.
wow… thanks… really its useful for me….
Hi,I installed the tomcat6 on windows 7 but am unable to connect to http://localhost:8080/
Thought i started the service , the Tomcat icon appears in the taskbar, can anybody suggest me..
Check that the Apache Tomcat 6 service is running via the Windows Services Management Console.
If the service is running and you still cannot connect then check that the configured port for tomcat is correct. Check in the %TOMCAT_INSTALL_FOLDER%/conf/server.xml file for the port value in the tag under .
Tomcat seems to work perfectly fine for me but connecting it to an Oracle Database is causing huge headaches!
Thanks Mr.Paul
Hi….just incase this helps…..noticed that service name on my windows 7 install is tomcat6…not “Apache tomcat 6″ as shown in screen above.
Not sure if this is specific to my installation, but thought it worth mentioning in case anyone else is looking for the more verbose service name.
Generally the longer DisplayName property on the service is used in the service console. I’m not sure why you are seeing the shorter Name property …
Hello! I have a problem with the installation. I finish the above steps but when i go to http://localhost:8080 my browser only shows a blank page. :\
As per the reply to Mohammed Aleem:
Check that the Apache Tomcat 6 service is running via the Windows Services Management Console.
If the service is running and you still cannot connect then check that the configured port for tomcat is correct. You can get the configured port in the %TOMCAT_INSTALL_FOLDER%/conf/server.xml file by checking the port attribute’s value in the Connector tag at the following XPath location – /Server/Service[@name="Catalina"]/Connector[@protocol="HTTP/1.1" ].
Paul,
Thank you for all the information you have in here. It is definitively very useful. I have the same problem than manolis and Mohammed. Basically when I try to open http://localhost:8080 I get the webpage not found error, but the apache icon still shows up in the inferior right corner. I went to the file you said and I get this from there: “Connector port=”8080″ redirectPort=”8443″ connectionTimeout=”20000″ protocol=”HTTP/1.1″/”. So I am assuming the port 8080 is correct. I have installed tomcat 6.0.33 in a windows 7 professional machine. I have tried giving the tomcat executable administrator privileges (right click, compatibility), I have tried installing tomcat 7, I have tried restarting the machine multiple times, I have tried both installing jre 7 and jdk 7, I have tried starting tomcat from eclipse. Nothing seems to work. I feel that I am running out of ideas. Any suggestion ?
Boris
Are you using Internet Explorer when trying to get to the http://localhost:8080 URL ? If so, make sure you are using the http:// prefix – IE doesn’t seem to route correctly without it.
Otherwise try Chrome and see if you have the same issue.
Paul,
Thank you for your answer. I should have mentioned that I though about that and I included the prefix “http://” when trying to access the server from IE, additionally I went ahead and I installed Chrome. It is interesting that in IE I get the bad request error, but in Chrome I get a blank page that only says “fail”. Additionally, I should mention that I added the variable %JAVA_HOME% to the environment variables and to path, but not success yet. Any ideas ?. Thanks,
Boris
Paul
Great blog. I am attempting to install Tomcat7 on a Win7pro machine. Installation went fine and the installer was able to start the service. As part of the installation for the specific webapp I am trialling however, I had to stop the service (which was done via the Tomcat monitor). I made some config changes using the monitor, specifically adding
-XX:PermSize=128m
-Xincgc
\ also the initial mermory pool and maximum mem pool to 512M
However when I restart the service using either windows service manager or Tomcat Monitor. The service simple enters a “Starting” state, never reaching the Started state. In this state it will not respond to stop commands or most other commands using sc.exe.
Any advice for debugging the installation.
Ben
Make sure that any Java options entered in the Tomcat Monitor’s Java Options text box do not have trailing whitespace – this has caught me out before.
If that still doesn’t help your best bet is to look in the latest %TOMCAT_INSTALL_FOLDER%/logs/catalina.*.log file to determine why tomcat is not starting up.
THanks so much Paul ….. its whitespace for me …
This site is very useful and important
Thank you…has been very very useful
Thank you Paul. Your info pushed me out of the rut I have been for the past couple of hours. Maybe you can help the Apache/Tomcat group with clearer installation steps on their website
Have a great one!
Great thankx….loved your blog….
Realy useful.
Thanx
hi
I have install tomcat on my window 7 machine,when typing localhost:8080 on i.e its showing unsuccessful but with chrome its showing installed
I seem to have the same issue with IE – you need to specify the http:// prefix otherwise IE does not seem to be able to route correctly to the site.
i have 8080 alredy used for jetty server, i changed the port to 8585 but im getting 404 page
hi manohar 404 error can b seen if u assign wrong url pattern at address bar of browser window. .Hope so So, one please confirm the and check 1s again c dat your servlet class matches with dat of your web resource prog’m and servlet name also both in servlet tag & servlet mapping.(check in web.xml) ex:http://localhost:8585/webappication_name/url-pattern if web server resides within your system
This is veryful.. Thanks a lot !!!
Very useful guide… thanks a bunch!
Hi……….. its too Good. I installed it apache in a good manner. Its very Useful. Thanks alot!!!
Thank you. Your post was very useful
Thank You….Finally tomcat is installed pn my computer…Thank You very much…
Reblogged this on Super Mekanismo and commented:
If you’re having trouble installing Tomcat. Here is a detailed step by step guide.
Worked exactly the same way for Tomcat 7. Apache Tomcat sit does not make it clear that the installer needs to be downloaded too to make everything smooth.
Your post made it simple
Thanks,
ChuckInAtl
After some initial steps i partially installed apache in my lap but i have one doubt in configure tab in apache property window the path should like this C:\Program Files\Java\jre1.6.0_01\bin\client\jvm.dll instead C:\Program Files\Java\jre1.6.0_01\bin\server\jvm.dll is this mean i had not installed my java properly?
It means that the installer didn’t pick up the Server VM – ensure that you have the JDK installed not just the JRE. Read the beginning of the post.
Thank You
You helped me sort out a problem which i am facing nearly 10 hours.
As a .net programmer i don’t know much about tomcat server,You guided me to install it in my pc.
thanks a ton Paul!
you’re a saviour..
i finally fixed up an issue i’d been coveting to get rid off!
BIG thanks!!!!
hey … i downloaded tomcat 6..but i cudnt find startup file to run it in bin folder…
i downloaded “32-bit/64-bit Windows Service Installer” only…
plz help me out
The Windows Service Installer installs Tomcat as a Windows Service and does not provide startup files in the bin folder. It is geared towards interacting with Tomcat via the Windows Service mechanisms.
thankz a lot..it was really helpfull
Thanks
thank you so much . your post was very usefull
Thank you so so much paul
Thanks it s very useful to install and configure the tomcat server….
One thing to keep in mind (that I ran into) is if you’ve already installed Oracle before this, it will hog up port 8080, which is the standard port that Tomcat uses. I tried editing the server.xml file, but it wouldn’t let me save it, even when I shut down Tomcat. So I just uninstalled and reinstalled using port 8181. Just some food for thought.
Hi Paul… I wanted to thank you for this VERY helpful clear post.
thank you very much……………..