Setup Spring in Eclipse and Environment

This tutorial will guide you on how to prepare a development environment to start your work with Spring Framework. This tutorial will also teach you how to setup JDK, Tomcat and Eclipse on your machine before you setup Spring Framework:

Step 1 - Setup Java Development Kit (JDK):

 Download latest java (JDK ) version from oracle's java site. 
Set to the class path for this JDK version in case Window OS.
set PATH=C:\jdk1.6.0_23\bin;%PATH%
set JAVA_HOME=C:\jdk1.6.0_23

Alternatively, on Windows NT/2000/XP, you could also right-click on My Computer, select Properties, then Advanced, then Environment Variables. Then, you would update the PATH value and press the OK button.

Setup Spring in Eclipse and Environment

On Unix (Solaris, Linux, etc.), if the SDK is installed in /usr/local/jdk1.6.0_23 and you use the C shell, you would put the following into your .cshrc file.
setenv PATH /usr/local/jdk1.6.0_23/bin:$PATH
setenv JAVA_HOME /usr/local/jdk1.6.0_23

Step 2 - Install Apache Common Logging API:

You can download the latest version of Apache Commons Logging API from http://commons.apache.org/logging/.

Setup Spring in Eclipse

Step 3 - Setup SpringSource Tool Suite (STS) IDE

To install SpringSource Tool Suite (STS)IDE, download the latest SpringSource Tool binaries from http://www.springsource.org/springsource-tool-suite-download . Once you downloaded the installation, unpack the binary distribution into a convenient location.
After a successful startup, if everything is fine then it should display following result:

 Spring Setup Environment

Step 4 - Setup Spring Framework Libraries

Now if evethen you can proceed to setup your Spring framework. Following are the simple steps to download and install the framework on your machine.
  • Make a choice whether you want to install Spring 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 Spring framework binaries from http://www.springsource.org/download.
  • At the time of writing this tutorial, I downloaded spring-framework-3.2.0.M1.zip on my Windows machine and when you unzip the downloaded file it will give you directory structure inside C:\
    spring-3.2.0.M1-dist.zip (sha1)
    as follows.

Spring Jars

You will find all the Spring libraries in the directory C:\spring-framework-3.2.0.M1\dist. Make sure you set your CLASSPATH variable on this directory properly otherwise you will face problem while running your application. If you are using Eclipse then it is not required to set CLASSPATH because all the setting will be done through Eclipse.

Once you are done with this last step, you are ready to proceed for your first Spring Example which you will see in the next chapter.

                                                    << Previous || Next >>


  1. Hi dinesh....Can you send me the link from where i can download spring framework binaries. Actually i found no link over the page you specified to download it.

    1. https://repo.springsource.org/libs-milestone-local/org/springframework/spring/3.2.0.M1/spring-3.2.0.M1-dist.zip