1.首先点击Create New Project
2.勾选Spring选项,点击next。
3.设置项目的名称和存放位置,点击finish,后面会自动下载相关模块。
4.下载完成后,Spring的jar包就都有了,有的配置文件也会自动生成,我这里没有自动生成,可以右击src,新建一个spring config文件。
5.Spring config 自动生成内容如下图:
6.简单例子---HelloWorld
右击src新建一个类HelloWorld,
import java.util.*; public class HelloWorld { private String weather; public void setWeather(String weather) { this.weather = weather; } public String getWeather() { return weather; } public void sayHello() { System.out.println("Hello world,today's "); System.out.println(new Date()); System.out.println("It's " + weather); } }