spring boot 项不用eclispe怎么运行
1个回答
展开全部
1.Eclipse中安装STS插件:
Help -> Eclipse Marketplace…
Search或选择“Popular”标签,选择Spring Tool Suite (STS) for Eclipse插件,安装:
2.New -> Project…
找到Spring目录,选择Spring Starter Project,Next
3、填写跟项目相关的各种信息,然后Next
4.选择需要的Dependency,然后Next:
5.Next,然后Finsh,新项目就创建好了,各个目录如下:
6.右键MySpringBootApplication中的main方法,Run As -> Spring Boot App,项目就可以启动了。
package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MySpringBootApplication {
public static void main(String[] args) {
SpringApplication.run(MySpringBootApplication.class, args);
}
}
12345678910111213
由于选择了web dependency默认启动一个Tomcat,8080端口监听
7.把application.properties改名为application.yml(个人喜欢),修改Tomcat的启动端口:
server:
port: 8081
Help -> Eclipse Marketplace…
Search或选择“Popular”标签,选择Spring Tool Suite (STS) for Eclipse插件,安装:
2.New -> Project…
找到Spring目录,选择Spring Starter Project,Next
3、填写跟项目相关的各种信息,然后Next
4.选择需要的Dependency,然后Next:
5.Next,然后Finsh,新项目就创建好了,各个目录如下:
6.右键MySpringBootApplication中的main方法,Run As -> Spring Boot App,项目就可以启动了。
package com.example;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class MySpringBootApplication {
public static void main(String[] args) {
SpringApplication.run(MySpringBootApplication.class, args);
}
}
12345678910111213
由于选择了web dependency默认启动一个Tomcat,8080端口监听
7.把application.properties改名为application.yml(个人喜欢),修改Tomcat的启动端口:
server:
port: 8081
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询