Installing Sun Java SE 6, Apache Maven 2 and Tomcat 5.5 on Windows OS
For using most of the enterprise technologies based on Java, you generally need at least the following components installed and configured on your system:
- Java SE or EE SDK
- A command line build tool
- A Java application server/container like Tomcat, Glassfish, JBoss etc.
Based on the Java based technology/framework you want to use, you may need to install further dependencies. Even though you may not need all the three components mentioned above to work with every Java technology, I found myself installing them way too many times when compared to any other Java component that I wanted a place to document the installation process of these three components specifically, if only to refer to this post from other Java tutorials.
Below I explain how to install Java SE 6, Apache Maven 2 and Apache Tomcat 5.5 software.
Installing Sun Java SE 6 on Microsoft Windows
Download Java SE 6
Download and install the latest version of Java SE(currently JDK 6 update 7). Just run the installer and follow the wizard. Note the installation directory where the wizard installs the Java package(default will be C:\Program Files\Java). You then need to set the two environment variables JAVA_HOME and PATH.
Create Java Environment Variables
Go to Control Panel -> System -> Advanced System Settings and click the “Environment Variables” button. Or Control Panel -> System, select the Advanced tab and click the “Environment Variables” button if you are using Windows XP.
- Click the New… button below the System variables pane and add a new environment variable called JAVA_HOME and set it to the path to your Java installation directory(e.g. C:\Programming Files\Java).

- Select the Path variable in System variables pane and add the path to Java bin directory to it.

Check Java Version and Confirm Install
Let us confirm the correct configuration of Java installation from the command line. Close all the open dialog boxes and start a new command prompt(Start/All Programs -> Accessories -> Command Prompt). Run the following commands in it(doesn’t matter what your current directory is):
C:\Program Files (x86)\Java\jdk1.6.0_06
$ java -version
C:\Program Files (x86)\Java\jdk1.6.0_06
If you get an error saying that the ‘java’ command is not recognised or is not available, then you need to check the values the above environment variables were set to once again.
For more details, refer to Sun’s instructions on how to install Java SE.
Installing Apache Maven 2 on Microsoft Windows
Download Maven 2
Download the latest stable version of Maven from Apache Maven Project website. Extract it to a directory and rename the installation directory to maven. I assume Maven is now located in c:\maven.

Create Maven 2 Environment Variables
Create a new M2_HOME environment variable. Click the New… button(below System Variables pane) and enter the details as follows:

Similarly create another environment variable called M2 and set it to the value %M2_HOME%\bin

Add %M2% to the Path variable.

Check Maven 2 Version and Confirm Install
To check if Maven is properly configured or not, start a command prompt and check its version:
C:\Program Files (x86)\Java\jdk1.6.0_06
$ mvn –version
Maven version: 2.0.9
Java version: 1.6.0_06
For more details, refer to instructions on Maven’s website on how to install Maven 2.
Installing Apache Tomcat on Microsoft Windows
Download Tomcat 5.5
Download Apache Tomcat 5.5(or any other version of your choice) and extract the package in a directory(say C:\tomcat).

Create Tomcat Environment Variables
Next we need to add the required environment variables.
- Edit the Path environment variable and add the path to Tomcat’s bin directory to it.

- Create a new environment variable called CATALINA_HOME and set it to the directory where Tomcat is installed. I had extracted the Tomcat package to c:\tomcat directory in earlier step, so I would set CATALINA_HOME to c:\tomcat.

Check Tomcat Version and Confirm Install
Verify Tomcat’s installation by running the following commands in the Windows command prompt:
C:\Program Files (x86)\Java\jdk1.6.0_06
$ echo %CATALINA_HOME%
C:\tomcat
$ version.bat
You will need to start and stop the tomcat service from the command line manually(or tools from other Java frameworks may do that for you automatically). But if you want to the tomcat server to start automatically when the operating service, you can install it as a Windows service. For more details, refer to instructions on Tomcat website on how to run Tomcat as a Windows service. I am not including those instructions here because I don’t run and don’t recommend running it as a service; YMMV.
Related Posts:
Readers who viewed this page, also viewed:
- Setting Up Development Environment For Grails on Windows Vista/XP
- C++ Development Environment on Windows using Eclipse Ganymede and Nuwen MinGW
- Develop Ruby Applications Using Eclipse IDE
- “Hello, World” Web Application using Struts 2 in NetBeans IDE 6.1
- Update or Install Applications on Debian/Ubuntu Without an Internet Connection






















