Você está na página 1de 19

How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

Android
Appium
Python
PostgreSQL
Java Core
Java EE
JDBC
Maven
Spring Core
Angular JS
jQuery
Node JS
Log4j
Selenium
TestNG
Interview Questions
All Tutorials
Contact Me

Search

 Spring Tutorial How To Install Spring IDE Eclipse Plugin


How To Install Spring IDE Eclipse Plugin

 Jerry Zhao  August 15, 2017  0

Spring IDE is a useful graphical development tool. It can make Spring application development easy.
This article will show you how to install it as a Eclipse plugin.
 1. Install Spring Plugin From Eclipse Marketplace

1. Open Eclipse, click ” Help —> Eclipse Marketplace”.

1 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

2. Input “Spring IDE” in popup dialog, Click Enter key.

2 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

3. Click Install button to install. After some time, all IDE related plugin list out. Choose them all.
Click Confirm button.

4. Choose “Accept terms of licence agreement”, click Finish button.


5. When plugin installation complete, you need to restart Eclipse.
6. After restart, you can see below picture which means installation success.

3 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

2. Create Spring Java Project

1. Open Eclipse, click ” File —> New —> Project ” menu item.
2. Choose ” Spring Legacy Project ” in popup dialog. Click Next.

4 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

3. Input project settings like below.

4. After click Finish button, you can see the project listed in Eclipse left panel. Because we choose
“Simple Spring Maven” in step 3. So all Spring related jars has been added in the project.

5 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

5. If you choose “Simple Java” in step 3, you need to add the jars manually. You can click here to
download the latest jars.

6. After download, unzip it to a local folder. Then add related jars into java project. You can read
Spring Hello World Example Use Maven And Eclipse to learn how to add the jars to project.
7. Spring use commons-logging by default, so you need to click here to download commons-logging
jar lib file. Then add it to project build path.

6 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

3. Create HelloWorld Java Bean.

1. Right click src/main/java , click ” New —> Class ” in the popup menu.
2. Input package name, class name in the popup dialog as below.

7 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

3. Input below java code in HelloWorld.java. Please note all the private instance field should has a
set and get method.
public class HelloWorld {

private String firstName;

private String lastName;

public String getFirstName() {


return firstName;
}

public void setFirstName(String firstName) {


this.firstName = firstName;
}

public String getLastName() {


return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}

public void sayHello()


{
System.out.println("Hello " + this.getFirstName() + " " + this.getLastName());
}
}

4. Create Spring Bean Configuration Xml File.

8 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

1. Right click src/main/resources  in left panel, Click ” New —> Others” in popup menu list.
2. Choose ” Spring Bean Configuration File ” in popup dialog. Click Next.

3. Input BeanSettings.xml in configuration file name text box, please note the xml file should be
saved in src/main/resources directory. Click Next.

9 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

4. Select related xsd in next dialog. We just select beans xsd.

10 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

5. Click Next, Finish to close the wizard. You can see BeanSettings.xml has been created in left
project tree.

READ :   Load Spring Beans From Multiple Configuration File

5. Add Java Bean To Bean Configuration File.

11 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

1. Double click BearSettings.xml file just created.


2. Click “New Bean” button in right panel “beans” tab.

3. Input bean id in the popup dialog as below. Click Browse button to select HelloWorld class we
just created in step 3. Click Next.

12 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

4. Add following two properties in next dialog.

13 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

5. Click Finish, Now click Source tab at the bottom, you can see bean definition in xml file.

6. Invoke HelloWorld Java Bean

1. Create class  com.dev2qa.example.spring.InvokeHelloWorldBean .

14 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

2. Add below java code in it.


public static void main(String[] args) {
/* Initiate Spring application context. */
ApplicationContext springAppContext = new ClassPathXmlApplicationContext("BeanSettings.xml");
/* Get HelloWorldBean by id. */
HelloWorld helloWorldBean = (HelloWorld) springAppContext.getBean("helloWorldBean");
/* Set bean field value. */
helloWorldBean.setFirstName("Lucky");
/* Call bean method. */
helloWorldBean.sayHello();
}

3. Run it, then you can see below output.

7. Source Code

1. Download “SpringExampleProject.zip”

 Posted in Spring Tutorial


 Tagged Eclipse Plugin, Hello World, Spring

 LEAVE A REPLY

15 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

Your email address will not be published. Required fields are marked *

 Comment

 Name *

 Email *

 Website

Post Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Previous Post: Spring Framework Overview


Next Post: Log4j Overview And Installation In Java Project

16 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

report this ad

Search …

 RECENT POSTS

iOS Swift Function External And Internal Parameter Name Example


How To Connect To MySQL Server After Install XAMPP On Mac OS
How To Add iOS App Icon, Image, Color Set To Xcode Project Assets Catalog Correctly
How To Change Swift Constraints To Make Autolayout Programmatically
How To Fix Swift Error LayoutConstraints Unable To Simultaneously Satisfy Constraints

17 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

report this ad

 POPULAR POSTS

Android ADB Install / Uninstall App Examples

Passing Data Between Activities Android Tutorial

How To Set Android SDK Path In Windows And Mac

How To Get Real File Path From Android Uri

Android Foreground Service Example

 TUTORIAL CATEGORIES

Android Tutorial
Angular JS Tutorial
Appium Tutorial
iOS Tutorial
J2EE Tutorial
Java Tutorial
JDBC Tutorial
JQuery Tutorial
Linux Tutorial
Log4j Tutorial
Mac Tutorial
Maven Tutorial
Network Tutorial
Node JS Tutorial
Python Tutorial
Selenium Tutorial
Spring Boot Tutorial
Spring Tutorial
Test Automation Tutorial
TestNG Tutorial
Tomcat Tutorial
Version Control
Webdriver Tutorial
Windows Tutorial
WordPress Tutorial

 TAGS CLOUD

Activity Android ActionBar Android Broadcast Android Button Android Content Provider Android Error Android File Android Gesture
Android Image Android Layout Android ListView Android Selector Android Service Android Storage Android Studio Android UI

18 of 19 8/5/19, 11:53 AM
How To Install Spring IDE Eclipse Plugin https://www.dev2qa.com/how-to-install-spring-ide-...

Best Practice CSV Eclipse Error File Fragment Grid Hello World Http Header IO JAVA BASIC JDBC jQuery Selector Json Logging MySQL PostgreSQL

Python Django RecyclerView Selenium Servlet Spring Spring Bean String Swift Swift Button Tomcat VirtualBox

XPATH

Copyright © 2019 . Powered by WordPress and Stargazer.

19 of 19 8/5/19, 11:53 AM

Você também pode gostar