Glad to see you got interest in Java! When it comes to web development using OOP (Object Oriented Programming) most of the time you have seen that people prefers to use Java language for JSP (Java Server Pages) development. To run JSP applications on Windows you need to configure it first. Lets see how to configure and setup an environment of Java on Windows 7.

Download Java Standard Edition

Sun Microsystems (acquired by Oracle) made available to download J2SE. J2SE is a software development kit (SDK) for developing Java/JSP applications. You will need to download latest version for Windows 7 (check for 32/64 bit) (size is around 80 MB).

Installing Java on Windows 7

The downloaded Java SDK file is a self-extracting .EXE. So just double click on that file and let it install onto your system. You then need to enter the location where Java is to be installed. Default it is C:Javajdk+version (for example C:/Javajdk1.6.0_02).

Download and Installing Apache Tomcat

Apache Tomcat is well known used server for Java applications. There are other servers too like IBM’s WebSphere, Oracle’s WebLogic. Here I am using Apache Tomcat.

As you have downloaded and installed Java, the same process need to follow for installing Tomcat. Download Apache Tomcat latest version and install it onto Windows.  Default it will be installed at C:/Program Files/Apache Software Foundation/Tomcat 7.0

It will ask you whether to start automatically when windows start. Let it start automatically until you get familiar with Java/Tomcat.

Configuring Environment

Your steps of download and installation are completed. Now the final step is to configure the environment to run Java applications. We need to set some environment variables that Java applications can use to find required components for proper operations.

  1. Right click on My Computer -> Properties -> Advanced system settings. This will open System Properties dialog box
  2. Now click on ‘Environment Variables‘ button. That will open the Environment Variables dialog box.
  3. Click on ‘New’ button under ‘System Variables’ section. Enter a name JAVA_HOME and type full path to your JDK (such as C:/Javajdk1.6.0_02.4) for the value.
  4. Again click on ‘New’ button under ‘System Variables’ section. Enter a name CATALINA_HOME and specify Tomcat location in the value field (like C:/Program Files/Apache Software Foundation/Tomcat 7.0). CATALINA_HOME is the project name for the Servlet engine within overall Tomcat project was called Catalina. It refers to Tomcat root.
  5. One more time click on ‘New’ button under ‘System Variables’ section. Enter a name CLASSPATH and type value as %CATALINA_HOME%common/lib/servlet.jar;
    If you already have CLASSPATH variable name then you will need to put semicolon (;) at the end of existing value.
  6. Now save these configurations by clicking on ‘OK’ buttons. Here we have completed the basic and standard configuration of Java on Windows 7.

Testing Tomcat

Now you need to test to make sure that Tomcat is working. Open your browser and type this URL in address bar: http://localhost:8080

You should see Tomcat’s default page with ‘You’ve successfully installed Tomcat’ message.

Try checking some JSP sample examples (comes with Tomcat test page) to get an idea how JSP code is written and how it get execute.

Okay! we are done here. Have fun with JSP! If you liked, please share this with others.