title: .ClassNotFoundException Spring Boot 2.0.0
body: <p>I'm new to spring and I'm trying to initialize a spring project using spring-boot 2.0.0 from <a href="https://start.spring.io/" rel="nofollow noreferrer">https://start.spring.io/</a> with web as the dependencies.</p>
  
  <p>it generates this pom.xml file</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &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;com.kkesley&lt;/groupId&gt;
      &lt;artifactId&gt;springtest&lt;/artifactId&gt;
      &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;
      &lt;packaging&gt;jar&lt;/packaging&gt;
  
      &lt;name&gt;springtest&lt;/name&gt;
      &lt;description&gt;Demo project for Spring Boot&lt;/description&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;2.0.0.RELEASE&lt;/version&gt;
          &lt;relativePath/&gt; &lt;!-- lookup parent from repository --&gt;
      &lt;/parent&gt;
  
      &lt;properties&gt;
          &lt;project.build.sourceEncoding&gt;UTF-8&lt;/project.build.sourceEncoding&gt;
          &lt;project.reporting.outputEncoding&gt;UTF-8&lt;/project.reporting.outputEncoding&gt;
          &lt;java.version&gt;1.8&lt;/java.version&gt;
      &lt;/properties&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;dependency&gt;
              &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
              &lt;artifactId&gt;spring-boot-starter-test&lt;/artifactId&gt;
              &lt;scope&gt;test&lt;/scope&gt;
          &lt;/dependency&gt;
      &lt;/dependencies&gt;
  
      &lt;build&gt;
          &lt;plugins&gt;
              &lt;plugin&gt;
                  &lt;groupId&gt;org.springframework.boot&lt;/groupId&gt;
                  &lt;artifactId&gt;spring-boot-maven-plugin&lt;/artifactId&gt;
              &lt;/plugin&gt;
          &lt;/plugins&gt;
      &lt;/build&gt;
  
  
  &lt;/project&gt;
  </code></pre>
  
  <p>and there's a main class</p>
  
  <pre><code>package com.kkesley.springtest;
  
  import org.springframework.boot.SpringApplication;
  import org.springframework.boot.autoconfigure.SpringBootApplication;
  
  @SpringBootApplication
  public class SpringtestApplication {
  
      public static void main(String[] args) {
          SpringApplication.run(SpringtestApplication.class, args);
      }
  }
  </code></pre>
  
  <p>The application looks simple but I cannot seem to run it. I used <code>mvnw spring-boot:run</code> in the project's root and got this</p>
  
  <pre><code>[INFO] Scanning for projects...
  [INFO]
  [INFO] -----------------------&lt; com.kkesley:springtest &gt;-----------------------
  [INFO] Building springtest 0.0.1-SNAPSHOT
  [INFO] --------------------------------[ jar ]---------------------------------
  [INFO]
  [INFO] &gt;&gt;&gt; spring-boot-maven-plugin:2.0.0.RELEASE:run (default-cli) &gt; test-compile @ springtest &gt;&gt;&gt;
  [INFO]
  [INFO] --- maven-resources-plugin:3.0.1:resources (default-resources) @ springtest ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] Copying 1 resource
  [INFO] Copying 0 resource
  [INFO]
  [INFO] --- maven-compiler-plugin:3.7.0:compile (default-compile) @ springtest ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO]
  [INFO] --- maven-resources-plugin:3.0.1:testResources (default-testResources) @ springtest ---
  [INFO] Using 'UTF-8' encoding to copy filtered resources.
  [INFO] skip non existing resourceDirectory C:\Users\kkesley\eclipse-workspace\springtest\src\test\resources
  [INFO]
  [INFO] --- maven-compiler-plugin:3.7.0:testCompile (default-testCompile) @
  springtest ---
  [INFO] Nothing to compile - all classes are up to date
  [INFO]
  [INFO] &lt;&lt;&lt; spring-boot-maven-plugin:2.0.0.RELEASE:run (default-cli) &lt; test-compile @ springtest &lt;&lt;&lt;
  [INFO]
  [INFO]
  [INFO] --- spring-boot-maven-plugin:2.0.0.RELEASE:run (default-cli) @ springtest ---
  [WARNING]
  java.lang.reflect.InvocationTargetException
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:496)
      at java.lang.Thread.run (Thread.java:748)
  Caused by: java.lang.NoClassDefFoundError: org/springframework/boot/SpringApplication
      at com.kkesley.springtest.SpringtestApplication.main (SpringtestApplication.java:10)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:496)
      at java.lang.Thread.run (Thread.java:748)
  Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
      at java.net.URLClassLoader.findClass (URLClassLoader.java:381)
      at java.lang.ClassLoader.loadClass (ClassLoader.java:424)
      at java.lang.ClassLoader.loadClass (ClassLoader.java:357)
      at com.kkesley.springtest.SpringtestApplication.main (SpringtestApplication.java:10)
      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke (Method.java:498)
      at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run (AbstractRunMojo.java:496)
      at java.lang.Thread.run (Thread.java:748)
  [INFO] ------------------------------------------------------------------------
  [INFO] BUILD FAILURE
  [INFO] ------------------------------------------------------------------------
  [INFO] Total time: 1.414 s
  [INFO] Finished at: 2018-03-23T11:29:12+11:00
  [INFO] ------------------------------------------------------------------------
  [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.0.0.RELEASE:run (default-cli) on project springtest: An exception occurred while running. null: InvocationTargetException: org/springframework/boot/SpringApplication: org.springframework.boot.SpringApplication -&gt; [Help 1]
  [ERROR]
  [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
  [ERROR] Re-run Maven using the -X switch to enable full debug logging.
  [ERROR]
  [ERROR] For more information about the errors and possible solutions, please read the following articles:
  [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
  </code></pre>
  
  <p>What's happening here? I just want to run the simple application.
  Thanks!</p>