fork download
  1. package hello;
  2.  
  3. import org.springframework.boot.*;
  4. import org.springframework.boot.autoconfigure.*;
  5. import org.springframework.stereotype.*;
  6. import org.springframework.web.bind.annotation.*;
  7.  
  8. @Controller
  9. @EnableAutoConfiguration
  10. public class SampleController {
  11.  
  12. @RequestMapping("/")
  13. @ResponseBody
  14. String home() {
  15. return "Hello World!";
  16. }
  17.  
  18. public static void main(String[] args) throws Exception {
  19. SpringApplication.run(SampleController.class, args);
  20. }
  21. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Main.java:10: error: class SampleController is public, should be declared in a file named SampleController.java
public class SampleController {
       ^
Main.java:3: error: package org.springframework.boot does not exist
import org.springframework.boot.*;
^
Main.java:4: error: package org.springframework.boot.autoconfigure does not exist
import org.springframework.boot.autoconfigure.*;
^
Main.java:5: error: package org.springframework.stereotype does not exist
import org.springframework.stereotype.*;
^
Main.java:6: error: package org.springframework.web.bind.annotation does not exist
import org.springframework.web.bind.annotation.*;
^
Main.java:8: error: cannot find symbol
@Controller
 ^
  symbol: class Controller
Main.java:9: error: cannot find symbol
@EnableAutoConfiguration
 ^
  symbol: class EnableAutoConfiguration
Main.java:12: error: cannot find symbol
    @RequestMapping("/")
     ^
  symbol:   class RequestMapping
  location: class SampleController
Main.java:13: error: cannot find symbol
    @ResponseBody
     ^
  symbol:   class ResponseBody
  location: class SampleController
Main.java:19: error: cannot find symbol
        SpringApplication.run(SampleController.class, args);
        ^
  symbol:   variable SpringApplication
  location: class SampleController
10 errors
stdout
Standard output is empty