title: Why doesn't the org.springframework.boot import work but the org.springframework.web does?
body: <p>I am trying to build this RESTful service example: <a href="https://spring.io/guides/gs/rest-service/" rel="nofollow noreferrer">https://spring.io/guides/gs/rest-service/</a>
  The <code>GreetingController.java</code> has no errors with the imports:</p>
  
  <pre><code>package hello;
  
  import java.util.concurrent.atomic.AtomicLong;
  import org.springframework.web.bind.annotation.RequestMapping;
  import org.springframework.web.bind.annotation.RequestMethod;
  import org.springframework.web.bind.annotation.RequestParam;
  import org.springframework.web.bind.annotation.RestController;
  
  @RestController
  public class GreetingController {
      private static final String template = "Hello, %s!";
      private final AtomicLong counter = new AtomicLong();
  
      @RequestMapping(value = "/greeting", method = RequestMethod.GET)
      public Greeting greeting(@RequestParam(value = "name", required = false, defaultValue = "World") String name) {
          return new Greeting(counter.incrementAndGet(), String.format(template, name));
      }
  }
  </code></pre>
  
  <p>But with <code>Application.java</code> I get:
  <img src="https://i.stack.imgur.com/XHvjH.png" alt="source code image with errors"></p>
  
  <p>I get the following error: <code>The import org.springframework.boot cannot be resolved.</code> I've added the Spring 4 library to the project with all the jars. Why does the first import work and the second doesn't? I also get no errors with the <code>@ComponentScan</code> annotation but I get an error with the <code>@EnableAutoConfiguration</code> annotation.</p>