Tomcat web server is always been the most used server in the concern of java web applications. In this tutorial, we will learn to download tomcat server and install it in our local machine so that we can use it to run our java web application.
Go to the following link and download the zip file of tomcat server :
Three links has been given above through which you can download your required version of tomcat server. I recommend Tomcat 6.0 which is widely used these days.
Download a zip from the Binary Distribution. It will make you download a zip file with name apache-tomcat-<tomcat version>.zip file.
Unzip the file in the folder where you want to install tomcat.
You have installed tomcat server, but before running Tomcat Server you have to confirm following things otherwise Tomcat Server will not run :
- JDK has been installed in machine. You machine must have installed JDK before running Tomcat. Tomcat used JDK to run the server instance. For Tomcat 6, JDK must be of version 5 or later.
- JAVA_HOME environmental variable is present in your system settings. JAVA_HOME environmental variable should be configured in your machine. If not then you can set it using following steps.
Setting JAVA_HOME environmental variable
Step 1. Right click on your computer icon in desktop and click on properties:
Step 2 : It will open up a window. Click on the “Advanced System Settings” link on the window which will open “System Properties” Window then click on “Environmental Variables”
Step 3. It will open following window :
Click on the “New” button under System variables and enter variable name as “JAVA_HOME” and variable value as the location of the directory where java has been installed.
Then click on “OK” buttons to confirm the change.
Go to the directory where tomcat has been installed and then go to “bin” directory. Click on startup.bat file which will run Tomcat Server.