名称 | 版本 | 下载地址 |
JDK | 1.7 | 下载地址:http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html 配置环境变量:略 验证:java -version ![]() |
Tomcat | 7+ | |
Maven | 3.2+ | |
Gradle | 1.12[size=10.5000pt]+ | 下载地址:[size=10.5000pt]https://gradle.org/releases/ 配置path环境变量:D:\java\gradle-4.0.1\bin 验证:gradle --version[size=10.5000pt] ![]() |
Spring CLI | 1.3.0 | 下载地址:repo.spring.io/snapshot/org/springframework/boot/spring-boot-cli/1.3.0.BUILD-SNAPSHOT/spring-boot-cli-1.3.0.BUILD-SNAPSHOT-bin.zip 配置path环境变量:D:\java\spring-boot-cli-1.3.0.BUILD-SNAPSHOT-bin\spring-1.3.0.BUILD-SNAPSHOT\bin; 验证:spring --version[size=10.5000pt] ![]() |
<?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.example</groupId> <artifactId>myproject</artifactId> <version>0.0.1-SNAPSHOT</version> <parent> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-parent</artifactId> <version>1.3.0.BUILD-SNAPSHOT</version> </parent> [size=10.5000pt] <!-- Additional lines to be added here... --> <!-- (you don't need this if you are using a .RELEASE version) --> <repositories> [size=10.5000pt] <repository> <id>spring-snapshots</id> <snapshots><enabled>true</enabled></snapshots> </repository> <repository> <id>spring-milestones</id> </repository>[size=10.5000pt] </repositories> <pluginRepositories> [size=10.5000pt] <pluginRepository> <id>spring-snapshots</id> </pluginRepository> <pluginRepository> <id>spring-milestones</id> </pluginRepository> </pluginRepositories> </project> |
<dependencies> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-web</artifactId> </dependency> </dependencies> |
import org.springframework.boot.*; import org.springframework.boot.autoconfigure.*; import org.springframework.stereotype.*; import org.springframework.web.bind.annotation.*; @RestController @EnableAutoConfiguration public class Example { @RequestMapping("/") String home() { return "Hello World!"; } public static void main(String[] args) throws Exception { SpringApplication.run(Example.class, args); } [size=10.5000pt]} |
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |