When using the idea:
1. Create a new project:
File-->new --->project-->spring initializr
Next:
Modify group (own package path) and artifact (project name)
When the web started the project, so select web check web strarter -> next
Fill in the path to save the file:
main directory into the src, run the program: Right-click on Run Run
Create a hello controller:
Run the program: visit localhost: 8080 / hello
Here are two other ways to start spring-boot:
By maven:
mvn sprint-boot:run
By jar package (the deployment):
First by maven package (packaged in the same directory src)
mvn clean package
Enter the target directory:
java -jar java -jar demo-0.0.1-SNAPSHOT.jar
Access localhost: 8080 / hello