我是Spring/Maven的新手,我正在学习本教程: 使用Spring MVC提供Web内容.
每次我跑mvn spring-boot:run,我都会收到这个错误:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.2.RELEASE:run (default-cli) on project gs-serving-web-content: Could not exec java: Application finished with exit code: 1 ->
我试图添加classpath,试图运行mvn install clean spring-boot:run,做了很多其他人在堆栈流程中建议的类似情况,花了超过8小时 - 没用.
这是我的主要课程Application.java:
package hello;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class Application {
public static void main(String[] args) throws Exception{
SpringApplication.run(Application.class, args);
}
}
Run Code Online (Sandbox Code Playgroud)
这是我的GreeetingController.java班级:
package hello;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@Controller
public class GreetingController {
@RequestMapping("/greeting") …Run Code Online (Sandbox Code Playgroud)