下载STS
http://spring.io/tools/sts/all,根据自己的电脑选择合适的OS。
安装JDK
- 下载
http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html,根据自己的电脑选择合适的JDK。 - 环境变量设置
linux电脑将JDK放置在/opt/java目录,并配置环境变量,将下面的shell赋值,copy到/etc/profile文件
JAVA_HOME=/opt/java/jdk1.8.0_144
export JRE_HOME=$JAVA_HOME/jre
export CLASSPATH=.:$JAVA_HOME/lib:$JRE_HOME/lib:$CLASSPATH
# If your system just has one jdk, use this line
#PATH=$JAVA_HOME/bin:$JRE_HOME/bin:$PATH
# If your system has multi jdks, use this line
export PATH=$PATH:${JAVA_HOME}/bin:${JRE_HOME}/bin
##
打开STS
- 新建一个Maven Project
- 在pom.xml中加入如下
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context</artifactId>
<version>4.3.11.RELEASE</version>
<scope>runtime</scope>
</dependency>
</dependencies>