As we discussed in our earlier tutorial about Spring Framework Introduction, for spring setup in your local machine we need the following prerequisites
- Java (need 1.6 or above for Spring 4.0)
- Java supported IDE like Eclipse, Netbeans etc
- Spring Release Library files.
- Web Server (for Spring Web Module)
SpringSource also provides us a tool called STS(Spring tool suite), which is built upon Eclipse and have the required plugin to create a new project as Spring projects as well as it will provide few template project structure also for spring. Spring recommended some build tool like Maven, Gradle or Ivy for the dependency of the library file. STS uses maven for creating and building the Spring projects.
Lets start the setup of Spring with Eclipse to create a java project.
- Download the Latest stable release of Spring Framework distribution, I found this link while writing this tutorial
http://maven.springframework.org/release/org/springframework/spring/ . Download the distribution from here and extract it.
- Click “add external jar” and point to lib directory which is under the Spring Framework distribution downloaded directory. Select all the jar file from there, As Spring Framework distribution will give you the source jar and java doc jar too, which help to get details of any class or methods while development.
- Spring need another library called Common logging which is basically used for log the system output. Common logging is under Apache licence and we can download it from http://commons.apache.org/proper/commons-logging/download_logging.cgi and add in the Spring user library(follow the step 4 to add that) After adding the jar now click finish. We will get a project structure like below screenshot.
Now we will try to understand the Spring IoC and Dependency Injection which is the core part of Spring Framework in your next tutorial.