Checking if JAVA is already installed in your system¶
Follow this step to check if Java software development kit (JDK) is already installed in your system. To determine if JAVA SDK is already installed in your system, run the following command from command prompt.
java –version
If JAVA platform is already installed, it will display the version of the JAVA SDK. Below screen shows JAVA version 1.6 running on a windows system. If command executes successfully and shows JAVA version 1.6, you can skip the next step.otherwise download and install the Java SDK as explained in next step.
Install JAVA SDK¶
First thing you need to install is Java software development kit (Java SDK) . Download the Java development kit 6 (JDK 6) from Sun Java SE Download site.
Set up the JAVA_HOME environment variable¶
Once the JAVA SDK is installed follow this step to set the JAVA_HOME environment variable. If JAVA_HOME variable is already set, you can skip this step.
Right click on My Computer icon on your desktop it will open a popup menu, click on properties, it will open the system properties window, then click on advanced tab.
Click on environment variables button, it will open the environment variables window as shown in figure below. Initially there will be no JAVA_HOME environment variable set as shown in figure.
Click on new button to add new system variable JAVA_HOME.
In the variable name filed, enter JAVA_HOME. Specify the path to root directory of JAVA installation in variable value field and click OK button. Now JAVA_HOME will appear under user variables.
Next you need to add bin directory under the root directory of JAVA installation in PATH environment variable.Select the PATH variable from System variables and click on Edit button.
Add: ;%JAVA_HOME%\bin; at the end of variable value field and click OK button.
Now verify that everything is correct by following the step: Checking if JAVA is already installed in your system. It should show the version of the installed JAVA SDK.
Installing Tomcat¶
Tomcat is an opensource web container. Download tomcat 6 from here. Download the apache-tomcat-6.0.32.tar.gz and extract it to the directory of your choice.
Starting and shutting down Tomcat¶
To start the tomcat server, open the command prompt, change the directory to TOMCAT HOME/bin and run the startup.bat file. It will start the server.
startup
To shut down the tomcat server, run the shutdown.bat file. It will stop the server.
shutdown
Verifying Tomcat installation¶
To verify that tomcat is installed properly, start the server as explained above, open the web browser and access the following URL.
http://localhost:8080/index.jsp
You should see the default Tomcat welcome page as shown here.