Springboot (1) helloworld built environment

Preface: with little knowledge of the work, most do not remember, to start from scratch once again.

A, springboot operating environment:

  1. jdk1.8: Spring Boot recommended jdk1.7 and above; java version "1.8.0_112"

  2.-maven3.x: maven 3.3 above; Apache Maven 3.3.9

    setting file to find the maven, path: apache-maven \ conf \-allocation information indicating the maven compiler with JDK 1.8, to avoid problems when playing jar package and compiled

<profile>
  <id>jdk-1.8</id>
  <activation>
    <activeByDefault>true</activeByDefault>
    <jdk>1.8</jdk>
  </activation>
  <properties>
    <maven.compiler.source>1.8</maven.compiler.source>
    <maven.compiler.target>1.8</maven.compiler.target>
    <maven.compiler.compilerVersion>1.8</maven.compiler.compilerVersion>
  </properties>
</profile>

  3.IDEA configuration, open the Idea of ​​Set listening window settings, configure Maven own installation, replacing Idea default maven Figure:

 

 

Second, the new projects spring-boot-hollowWorld, add web, click Next to complete the building.

 

 

  

 2. Establish and a method to map the path:

 

 3 page views, returns the string "hello world" success

 

 

Third, use maven package, start the program with the command method, simplifying deployment.

  1. Run the command maven package, maven project will be packaged into jar package, note that manual construction projects, pay attention to the plug-pom wrote plungin jar file.

  Packaging Success jar storage directory 

 

 

   After running the lay 2.jar package jar directory: java -jar Spring-boot-hollowworld-0.0.1-SNAPSHOT.jar executable. Note: java -jar command can be followed by other parameters, the port number, deployment ring. Baidu can intercept too much java -jar

Guess you like

Origin www.cnblogs.com/jonrain0625/p/11257094.html