SpringSource Tool Suite 基于 Spring IDE ,提供了其它的一些特性,如 基于Spring dm Server 的osgi 开发,及其它一些 Spring 项目的支持,如Spring Roo, Spring Batch等。
在浏览器输入 https://spring.io/tools 进入网页,根据你的操作系统,选择合适版本。如下图:
笔者电脑为 Win10,因此笔者选择了“WINDOWS 64-BIT”版本,下载地址:https://download.springsource.com/release/STS4/4.7.0.RELEASE/dist/e4.16/spring-tool-suite-4-4.7.0.RELEASE-e4.16.0-win32.win32.x86_64.self-extracting.jar
下载成功你的磁盘将多出“spring-tool-suite-4-4.7.0.RELEASE-e4.16.0-win32.win32.x86_64.self-extracting.jar”文件。我们可以打开 DOS 窗口,输入“java -jar spring-tool-suite-4-4.7.0.RELEASE-e4.16.0-win32.win32.x86_64.self-extracting.jar”对文件进行解压,步骤如下:
下载过程中将会出现一个进度条,如下图:
解压完成后,会出现如下目录。如下图:
双击“SpringToolSuite4.exe”启动软件。如下图:
(1)选择“File”、“New”、“Spring Starter Project”菜单,去打开创建 Spring Boot 项目的弹出框。如下图:
(2)根据自己的实际情况填写项目名称、项目类型(Maven、Gradle)、打包类型、编程语言、Java版本、Maven Group、Maven Artifact等信息。如下:
填写完项目信息后,点击“Next”按钮。
(3)为项目添加依赖,左边为可选依赖,右边为已选择的依赖。如下图:
项目依赖选择完后后,点击“Finish”完成项目创建。
(4)项目创建完成后,项目结构如下图:
(5)运行“Demo1Application”类,运行结果如下图:
. ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.3.1.RELEASE) 2020-07-14 23:18:46.081 INFO 19904 --- [ restartedMain] com.example.demo.Demo1Application : Starting Demo1Application on ZTQ8K2L3GC8MXN9 with PID 19904 (D:\learn\SpringToolSuite_workspace\demo1\target\classes started by Administrator in D:\learn\SpringToolSuite_workspace\demo1) 2020-07-14 23:18:46.092 INFO 19904 --- [ restartedMain] com.example.demo.Demo1Application : No active profile set, falling back to default profiles: default 2020-07-14 23:18:46.435 INFO 19904 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable 2020-07-14 23:18:46.435 INFO 19904 --- [ restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG' 2020-07-14 23:18:57.731 INFO 19904 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat initialized with port(s): 8080 (http) 2020-07-14 23:18:57.773 INFO 19904 --- [ restartedMain] o.apache.catalina.core.StandardService : Starting service [Tomcat] 2020-07-14 23:18:57.774 INFO 19904 --- [ restartedMain] org.apache.catalina.core.StandardEngine : Starting Servlet engine: [Apache Tomcat/9.0.36] 2020-07-14 23:18:58.042 INFO 19904 --- [ restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/] : Initializing Spring embedded WebApplicationContext 2020-07-14 23:18:58.042 INFO 19904 --- [ restartedMain] w.s.c.ServletWebServerApplicationContext : Root WebApplicationContext: initialization completed in 11606 ms 2020-07-14 23:18:58.749 INFO 19904 --- [ restartedMain] o.s.s.concurrent.ThreadPoolTaskExecutor : Initializing ExecutorService 'applicationTaskExecutor' 2020-07-14 23:19:00.409 WARN 19904 --- [ restartedMain] o.s.b.a.f.FreeMarkerAutoConfiguration : Cannot find template location(s): [classpath:/templates/] (please add some templates, check your FreeMarker configuration, or set spring.freemarker.checkTemplateLocation=false) 2020-07-14 23:19:00.536 INFO 19904 --- [ restartedMain] o.s.b.d.a.OptionalLiveReloadServer : LiveReload server is running on port 35729 2020-07-14 23:19:00.755 INFO 19904 --- [ restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer : Tomcat started on port(s): 8080 (http) with context path '' 2020-07-14 23:19:00.823 INFO 19904 --- [ restartedMain] com.example.demo.Demo1Application : Started Demo1Application in 16.46 seconds (JVM running for 18.039)