Struts 2 Download

Download and Installing Struts 2. In this section we will download and install the Struts 2.0 on the latest version of Tomcat container. In this section we will download and install the Struts 2.0 on the latest version of Tomcat container.

  • Struts 2 Tutorial
  • Struts 2 Tags
  • Struts 2 Integrations
  • Struts 2 Useful Resources

Struts 2 Jar Files Download For Eclipse

  • Selected Reading

Our first task is to get a minimal Struts 2 application running. This chapter will guide you on how to prepare a development environment to start your work with Struts 2.

I assume that you already have JDK (5+), Tomcat and Eclipse installed on your machine. If you do not have these components installed, then follow the given steps on fast track −

Struts 2 Example Application Download

Step 1 - Setup Java Development Kit (JDK)

You can download the latest version of SDK from Oracle's Java site − Java SE Downloads. You will find instructions for installing JDK in downloaded files, follow the given instructions to install and configure the setup. Finally, set PATH and JAVA_HOME environment variables to refer to the directory that contains java and javac, typically java_install_dir/bin and java_install_dir respectively.

If you are running Windows and installed the SDK in C:jdk1.5.0_20, you should be inputting the following line in your C:autoexec.bat file.

Alternatively, on Windows NT/2000/XP −

  • You can right-click on My Computer, Select Properties, then Advanced, then Environment Variables. Then, you would update the PATH value and press the OK button.

  • On Unix (Solaris, Linux, etc.), if the SDK is installed in /usr/local/jdk1.5.0_20 and you use the C shell, you would put the following into your .cshrc file.

On Unix (Solaris, Linux, etc.), if the SDK is installed in /usr/local/jdk1.5.0_20 and you use the C shell, you would put the following into your .cshrc file.

Alternatively, if you use an Integrated Development Environment (IDE) like Borland JBuilder, Eclipse, IntelliJ IDEA, or Sun ONE Studio, compile and run a simple program to confirm that the IDE knows where you installed Java, otherwise do proper setup as per the given document of IDE.

Struts 2 jars download

Step 2 - Setup Apache Tomcat

You can download the latest version of Tomcat from https://tomcat.apache.org/. Once you downloaded the installation, unpack the binary distribution into a convenient location.

For example in C:apache-tomcat-6.0.33 on windows, or /usr/local/apachetomcat-6.0.33 on Linux/Unix and create CATALINA_HOME environment variable pointing to these locations.

You can start Tomcat by executing the following commands on windows machine, or you can simply double click on startup.bat

Tomcat can be started by executing the following commands on Unix (Solaris, Linux, etc.) machine −

After a successful startup, the default web applications included with Tomcat will be available by visiting http://localhost:8080/. If everything is fine, then it should display the following result −

Further information about configuring and running Tomcat can be found in the documentation included here, as well as on the Tomcat website: https://tomcat.apache.org/

Tomcat can be stopped by executing the following commands on windows machine −

Tomcat can be stopped by executing the following commands on Unix (Solaris, Linux, etc.) machine −

Step 3 - Setup Eclipse (IDE)

All the examples in this tutorial are written using Eclipse IDE. I suggest that, you have the latest version of Eclipse installed in your machine.

To install Eclipse Download the latest Eclipse binaries from https://www.eclipse.org/downloads/. Once you download the installation, unpack the binary distribution into a convenient location.

Struts2 download with xwork

For example in C:eclipse on windows, or /usr/local/eclipse on Linux/Unix and finally set PATH variable appropriately. Eclipse can be started by executing the following commands on windows machine, or you can simply double click on eclipse.exe

Eclipse can be started by executing the following commands on Unix (Solaris, Linux, etc.) machine −

Struts 2 Example

After a successful startup, if everything is fine, it should display the following result −

Step 4 - Setup Struts2 Libraries

Now if everything is fine, then you can proceed to setup your Struts2 framemwork. Following are the simple steps to download and install Struts2 on your machine.

  • Make a choice whether you want to install Struts2 on Windows, or Unix and then proceed to the next step to download .zip file for windows and .tz file for Unix.

  • Download the latest version of Struts2 binaries from https://struts.apache.org/download.cgi.

  • At the time of writing this tutorial, I downloaded struts-2.0.14-all.zip and when you unzip the downloaded file it will give you directory structure inside C:struts-2.2.3 as follows.

Spring Mvc

Second step is to extract the zip file in any location, I downloaded & extracted struts-2.2.3-all.zip in c: folder on my Windows 7 machine so that I have all the jar files into C:struts-2.2.3lib. Make sure you set your CLASSPATH variable properly otherwise you will face problem while running your application.