How to Download and Setup Spring Framework for Eclipse IDE

How to Download and Setup Spring Framework for Eclipse IDE

To download Spring Framework, go to the link:

http://repo.spring.io/release/org/springframework/spring/

Search the most recent version. At the time of writing this article, it’s

3.2.5.RELEASE/            06-Nov-2013 19:50    -

Click it, and you see some items. Choose the first one:

spring-framework-3.2.5.RELEASE-dist.zip             06-Nov-2013 19:51  48.05 MB

Click to download the libraries in zip archive. Unzip it. Note that I use Linux but there’s no difference for you.

You should get into the main directory of Spring Framework, and then into libs one. There are jar archives you need for Eclipse.

Ok. Open Eclipse.

Create a new Java project: File -> New -> Java Project (or click Other… if you don’t see this item) -> Choose your Project Name -> Next -> Finish

Now you see your project in Eclipse (in Package Explorer on the left).

Right click the project -> Build Path -> Configure Build Path

Click Libraries Tab -> Click Add External JARs -> Search your main Spring Framework directory, then libs one -> Highlight all libraries (jars) -> OK

You see the libraries you will add to your project -> OK

You have the Spring libraries added to your other libraries in your project.

It’s not all you need. You should download commons-logging from:

http://commons.apache.org/proper/commons-logging/download_logging.cgi

Unpack it to have the directory with libraries.

Right click the project -> Build Path -> Configure Build Path

Click Libraries Tab -> Click Add External JARs -> Search your main commons-logging directory -> Highlight all libraries (jars) -> OK

You see the libraries you will add to your project -> OK

Now you have all what you need to build Spring applications in  Eclipse.

Go with coding!

Warning:

There’s some error in Eclipse IDE when you try running your application. If you run your application with open xml configuration file (usually Beans.xml, but the name can be  different – it depends on you which name you chose), you will get a strange error in console. It’s a false error. To avoid it, just don’t start you application at Bean.xml file opened. It can be started on other file opened, for example the main class of your project. Try it out.

2 thoughts on “How to Download and Setup Spring Framework for Eclipse IDE

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s