:::: MENU ::::

Spring Setup

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.

    1. 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.


    1. Now open your Eclipse and create a new java project, After giving the name to the project press Next and Choose the Library tab.



    1. We will add the Spring related library in the Eclipse, So Click on the User Library → New and give a name “Spring4.0” for further reference.




    1. 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.




    1. 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.

Koushik Ghosh

Koushik Ghosh

Co-founder of CodeStrive. I am a developer in Java. I love coffee, music, coding, open source technology and playing Counter Strike. Feel free to connect me ..
Koushik Ghosh

Latest posts by Koushik Ghosh (see all)

Spring Introduction
Spring IoC and Dependency Injection
Pride that quarells at self-breath