user3014290
user3014290

Reputation: 49

How to add jar files for spring in Eclipse IDE project folder

I am going to start MVC with Spring framework, but I am unable to get jar file of spring framework .I have tried in help menu>install new software>add new in Eclipse IDE but I failed. Can anyone please guide me ?

Upvotes: 3

Views: 76830

Answers (2)

Marcelo Tataje
Marcelo Tataje

Reputation: 3871

You can try download STS (Spring Source Tool Suite) from this link:

http://spring.io/tools

Of course, you should try Maven which is easy to use and adds value to the libraries and additional components you handle in your project.

If you want to add the libraries manually and work without any library handler like maven, then you can do the following:

  1. Create a new Java Project
  2. Over your project, right click and then create a new folder, call it "libs"
  3. Download the latest libraries of Spring 3 MVC: http://projects.spring.io/spring-framework/
  4. Once you've downloaded the libraries, extract the content of the zip and copy the required "jar" files inside the folder "libs" you've just created.
  5. Once you copied the files to the folder, select all the files, right-click, look at "Build Path" and click on "Add to Build Path"
  6. then in the project explorer, you will be able to see that in "Referenced Libraries" you have the Spring libraries.
  7. Just have fun.

But as recommended and suggested, try downloading maven, there is an integration also if you go and install from the Eclipse Market: m2eclipse.

Then, another option is like many people answered you: use STS, which comes with maven and will make your work easier and faster.

Now seems like Spring just wants to work with dependency managers, so you can go to the central repository and download the parts you need, here you have the link:

http://mvnrepository.com/artifact/org.springframework/

Regards.

Upvotes: 10

Dan
Dan

Reputation: 2719

There are several options.

One you could download Spring Tool Suite which is an Eclipse-based development environment that is customized for developing Spring applications. This might be your best bet because this will contain everything you need in one neat package.

Second, you can create a Maven project which will allow you to add the Spring dependencies in a pom.xml file. This might not be ideal because then you would have to learn Maven but once you get past the learning curve it is amazingly simple to add jars to your web project.

Lastly, you can download each Spring jar individually (probably the least effective method) and then add the library to your Eclipse environment. To do this save the jar to a location on your hard drive, open eclipse, right click on your project, select properties, click on Java Build Path, click the Libraries tab and then Add External JARS...

I hope this helps!

Upvotes: 4

Related Questions