Apache Struts was one of the dominant Java web frameworks from the early 2000s through the mid-2010s. While Spring Framework (particularly Spring Boot) has largely replaced Struts in modern development, many organizations still maintain Struts-based applications. This tutorial serves developers who need to work with legacy Struts codebases or understand historical Java web development patterns.
If you're starting a new Java web project in 2026, Spring Boot is the recommended choice. However, learning Struts remains valuable for maintaining existing enterprise applications, understanding the evolution of Java web frameworks, or working in organizations with significant Struts investments.
Released in 2000, Apache Struts introduced the Model-View-Controller (MVC) pattern to Java web development at a time when most developers were writing servlet code with embedded HTML. Struts provided:
By 2010, however, Spring MVC emerged with annotation-based configuration and more flexible architecture. Today, Spring Boot's convention-over-configuration approach and embedded server support make it the industry standard for Java web development.
While Struts was originally developed for Java 1.4 and 1.5, modern Struts versions support current JDK releases. For this tutorial, we'll use Java 17 or later (Java 17, 21, or 25), as these are the current Long-Term Support (LTS) releases.
Download the latest Java Development Kit from Oracle or adopt an open-source alternative:
Modern JDK installers typically handle PATH configuration automatically. However, if manual configuration is needed:
C:\Program Files\Java\jdk-25JAVA_HOME = C:\Program Files\Java\jdk-25PATH - Add %JAVA_HOME%\bin to the existing PATHFor bash shell, add to ~/.bashrc or ~/.bash_profile:
export JAVA_HOME=/usr/lib/jvm/jdk-25
export PATH=$JAVA_HOME/bin:$PATH
For zsh shell (default on modern Macs), add to ~/.zshrc:
export JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk-25.jdk/Contents/Home
export PATH=$JAVA_HOME/bin:$PATH
Open a new terminal or command prompt and verify:
java -version
javac -version
Both commands should display version information for Java 17 or later.
Apache Struts is available in two major versions: Struts 1.x (legacy, end-of-life) and Struts 2.x (still maintained). For learning purposes or legacy maintenance, you'll likely need Struts 2.x.
C:\struts or ~/strutslib/ - JAR files for your classpathapps/ - Sample applicationsdocs/ - Documentation
If you're setting up a new Struts project or maintaining an existing Maven-based project, add Struts as a dependency in your pom.xml:
<dependency>
<groupId>org.apache.struts</groupId>
<artifactId>struts2-core</artifactId>
<version>6.4.0</version>
</dependency>
Maven will automatically download Struts and all required dependencies.
For Gradle projects, add to your build.gradle:
dependencies {
implementation 'org.apache.struts:struts2-core:6.4.0'
}
Modern IDEs handle JDK and framework configuration automatically. If you're using IntelliJ IDEA, Eclipse, or NetBeans:
Before investing significant time in Struts, consider whether Spring Boot might be a better fit for your needs:
| Aspect | Apache Struts | Spring Boot |
|---|---|---|
| Initial Release | 2000 (Struts 1), 2006 (Struts 2) | 2014 |
| Configuration | XML-based or annotations | Annotation-based, minimal configuration |
| Learning Curve | Moderate to steep | Easier for beginners |
| Community & Support | Small, declining | Very large, growing |
| Security Updates | Still maintained but slower | Frequent updates |
| Job Market | Legacy maintenance roles | High demand, modern development |
You should proceed with learning Struts if you:
If you're starting fresh with no legacy constraints, begin with Spring Boot instead. Spring Boot offers better tooling, documentation, community support, and career prospects in 2026.
Now that you have the JDK installed and understand Struts' place in the Java ecosystem, you're ready to create your first Struts application. The next lesson will guide you through:
Remember: Struts knowledge remains valuable for maintenance scenarios, but stay informed about modern alternatives to make informed technology choices for new projects.