title: Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
body: <p>Just joined and just started learning spring boot. I wrote my first application which is as below:</p>
  
  <p>SpringBootApiApp.java</p>
  
  <pre><code>import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  
  public class SpringBootApiApp {
  
      public static void main(String[] args) {
          SpringApplication.run(SpringBootApiApp.class, args);
      }
  
  }
  </code></pre>
  
  <p>pom.xml</p>
  
  <pre><code>&lt;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"&gt;
    &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;
    &lt;groupId&gt;io.springbootquickstart&lt;/groupId&gt;
    &lt;artifactId&gt;SpringBootQuickStart&lt;/artifactId&gt;
    &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
    &lt;name&gt;SpringBootApplication&lt;/name&gt;
  
    &lt;parent&gt;
      &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
      &lt;artifactId&gt;spring-boot-starter-parent&lt;/artifactId&gt;
      &lt;version&gt;1.4.2.RELEASE&lt;/version&gt;
    &lt;/parent&gt;
  
    &lt;dependencies&gt;
      &lt;dependency&gt;
          &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
          &lt;artifactId&gt;spring-boot-starter-web&lt;/artifactId&gt;    
      &lt;/dependency&gt;
  &lt;/dependencies&gt;
  
    &lt;properties&gt;
      &lt;java.version&gt;1.8&lt;/java.version&gt;
    &lt;/properties&gt;
  
  &lt;/project&gt;
  </code></pre>
  
  <p>When I run the java class in STS as a Java application, I see the below error, I don't see a compilation error though:Please help me fixing it. </p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
      at SpringBootApiApp.main(SpringBootApiApp.java:9)
  Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
      at java.net.URLClassLoader.findClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
      at java.lang.ClassLoader.loadClass(Unknown Source)
      ... 1 more
  </code></pre>