按照了spring boot官网上的helloworld例子,但是编译出现java.lang.NoClassDefFoundError: com/he/OfficialDemo,package com.he;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
/**
- �ٷ�����
-
@author pzr
*
*/
@Controller
@EnableAutoConfiguration
public class OfficialDemo {
@RequestMapping("/test")
@ResponseBody
String home() {
System.out.println("OfficialDemo.home()");
return "Hello World!";
}public static void main(String[] args) throws Exception {
SpringApplication.run(OfficialDemo.class, args);
}
}
我的代码
`