title: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
body: <p>This is a follow up question to this question:</p>
  
  <p><a href="https://stackoverflow.com/questions/20740703/java-lang-classnotfoundexception-org-springframework-boot-springapplication-mav">java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication Maven</a></p>
  
  <p>I have developed a web service using Eclipse on Windows. I need to run it on a Solaris station and there I get the ClassNotFoundException. </p>
  
  <p>This is my pom.xml: (that maven shade plugin is something I've read about that can create an uber jar with all the dependecies).</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  </code></pre>
  
  <p>http://maven.apache.org/xsd/maven-4.0.0.xsd">
      4.0.0</p>
  
  <pre><code>&lt;groupId&gt;org.springframework&lt;/groupId&gt;
  &lt;artifactId&gt;gs-rest-service&lt;/artifactId&gt;
  &lt;version&gt;0.1.0&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&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.2.5.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;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;plugin&gt;
      &lt;groupId&gt;org.apache.maven.plugins&lt;/groupId&gt;
      &lt;artifactId&gt;maven-shade-plugin&lt;/artifactId&gt;
  
      &lt;executions&gt;
        &lt;execution&gt;
          &lt;phase&gt;package&lt;/phase&gt;
          &lt;goals&gt;
            &lt;goal&gt;shade&lt;/goal&gt;
          &lt;/goals&gt;
          &lt;configuration&gt;
            &lt;transformers&gt;
              &lt;transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"&gt;
                &lt;mainClass&gt;com.group.id.Launcher1&lt;/mainClass&gt;
              &lt;/transformer&gt;
            &lt;/transformers&gt;
          &lt;/configuration&gt;
        &lt;/execution&gt;
      &lt;/executions&gt;
    &lt;/plugin&gt;
      &lt;/plugins&gt;
  
  &lt;/build&gt;
  
  &lt;repositories&gt;
      &lt;repository&gt;
          &lt;id&gt;spring-releases&lt;/id&gt;
          &lt;url&gt;https://repo.spring.io/libs-release&lt;/url&gt;
      &lt;/repository&gt;
  &lt;/repositories&gt;
  &lt;pluginRepositories&gt;
      &lt;pluginRepository&gt;
          &lt;id&gt;spring-releases&lt;/id&gt;
          &lt;url&gt;https://repo.spring.io/libs-release&lt;/url&gt;
      &lt;/pluginRepository&gt;
  &lt;/pluginRepositories&gt;
  </code></pre>
  
  <p></p>
  
  <p>And this is the exception I get when trying to run the jar on Solaris:</p>
  
  <blockquote>
    <p>Caused by: java.lang.ClassNotFoundException: org.springframework.boot.SpringApplication
            at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
            at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
            at java.security.AccessController.doPrivileged(Native Method)
            at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
            at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
            at java.lang.ClassLoader.loadClass(ClassLoader.java:358)</p>
  </blockquote>
  
  <p>The project got a "Maven Dependencies" folder with many jar files of the Spring framwork. </p>
  
  <p>I did not really understand the answers to that question. The main answer suggested creating a consolidated jar as shown here: <a href="https://stackoverflow.com/questions/574594/how-can-i-create-an-executable-jar-with-dependencies-using-maven">How can I create an executable JAR with dependencies using Maven?</a></p>
  
  <p>But i did not fully understand how to create that conolidated jar. Do I need to add the lines in the answer to the pom file? or somewhere else? and running the <code>mvn clean compile assembly:single</code> should be done in windows in the command line? and if so on which path? won't just exporting to jar suffice?</p>
  
  <p>If someone could make a list of operations of what to do, that'll be great.</p>