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_23bin;%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.M1dist. 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.
Spring Related Topics you may like

  1. Spring Interview Questions and Answers
  2. Spring AOP Interview Questions and Answers
  3. Spring MVC Interview Questions
  4. Spring Security Interview Questions and Answers
  5. Spring REST Interview Questions and Answers
  6. Spring Boot Interview Questions and Answers
  7. Spring Boot Microservices Interview Questions and Answers
  8. Dependency Injection (DI) in Spring
  9. Spring IoC Container
  10. What is Bean Factory in Spring
  11. ApplicationContext in Spring
  12. Bean Autowiring in Spring
  13. Spring Bean Scopes
  14. Create Custom Bean Scope in Spring Example
  15. Using ApplicationContextAware in Spring
  16. Spring Bean Life Cycle and Callbacks
  17. BeanPostProcessor in Spring
  18. BeanFactoryPostProcessor in Spring
  19. Annotations in Spring and Based Configuration
  20. Spring JSR-250 Annotations
  21. JSR 330 Annotations in Spring
  22. Spring @Component, @Repository, @Service and @Controller Stereotype Annotations
  23. Method injection with Spring using Lookup method property
  24. Spring AOP-Introduction to Aspect Oriented Programming
  25. @Aspect Annotation in Spring
  26. Spring AOP AspectJ @Before Annotation Advice Example
  27. Spring AOP Before Advice Example using XML Config
  28. Spring AOP AspectJ @After Annotation Advice Example
  29. Spring AOP After Advice Example using XML Config
  30. Spring AOP AspectJ @AfterReturning Annotation Advice Example
  31. Spring AOP After-Returning Advice Example using XML Config
  32. Spring AOP AspectJ @AfterThrowing Annotation Advice Example
  33. Spring AOP After Throwing Advice Example using XML Config
  34. Spring AOP AspectJ @Around Annotation Advice Example
  35. Spring AOP Around Advice Example using XML Config
  36. Spring AOP Proxies in Spring
  37. Spring AOP Transaction Management in Hibernate
  38. Spring Transaction Management
  39. Spring Declarative Transaction Management Example
  40. Spring AOP-Ordering of Aspects with Example
  41. Spring Security Java Based Configuration with Example
  42. Spring Security XML Namespace Configuration Example

 

                                                    << Previous || Next >>

 

Previous
Next

3 Comments

  1. Dinesh Rajput June 15, 2012
  2. gaurav goel January 20, 2014