title: executing jar file: Caused by: java.lang.ClassNotFoundException: org.springframework.context.ApplicationContext
body: <p>I have created a maven project. After I type: mvn clean package everything works fine and I see my jar file inside target. But if I click the file I get the follwing error message:</p>
  
  <pre><code>Exception in thread "main" java.lang.NoClassDefFoundError: org/springframework/c
  ontext/ApplicationContext
  Caused by: java.lang.ClassNotFoundException: org.springframework.context.Applica
  tionContext
          at java.net.URLClassLoader$1.run(Unknown Source)
          at java.security.AccessController.doPrivileged(Native Method)
          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)
  Could not find the main class: comt.test.Test. Program will exit
  </code></pre>
  
  <p>I can run the project under Eclipse and works ok, but the jar file doesnt work.</p>
  
  <p>This is the content of Manifest:</p>
  
  <pre><code>Manifest-Version: 1.0
  Archiver-Version: Plexus Archiver
  Created-By: Apache Maven
  Build-Jdk: 1.6.0_23
  Main-Class: com.stlpo.App
  Class-Path: commons-httpclient-3.1.jar commons-codec-1.2.jar h2-1.2.138.jar 
  commons-lang-2.5.jar spring-core-3.0.3.RELEASE.jar spring-asm-3.0.3.RELEASE.jar co
   mmons-logging-1.1.1.jar spring-context-3.0.3.RELEASE.jar spring-beans
   -3.0.3.RELEASE.jar spring-expression-3.0.3.RELEASE.jar spring-orm-3.0
   .3.RELEASE.jar spring-tx-3.0.3.RELEASE.jar spring-aop-3.0.3.RELEASE.j
   ar aopalliance-1.0.jar spring-jdbc-3.0.3.RELEASE.jar spring-test-3.0.
   3.RELEASE.jar cglib-nodep-2.2.jar logback-core-0.9.24.jar logback-cla
   ssic-0.9.24.jar slf4j-api-1.6.0.jar hibernate-annotations-3.5.4-Final
   .jar hibernate-core-3.5.4-Final.jar antlr-2.7.6.jar commons-collectio
   ns-3.1.jar jta-1.1.jar hibernate-commons-annotations-3.2.0.Final.jar 
   hibernate-jpa-2.0-api-1.0.0.Final.jar hibernate-entitymanager-3.5.4-F
   inal.jar cglib-2.2.jar asm-3.1.jar javassist-3.9.0.GA.jar opencsv-2.1
   .jar jfreechart-1.0.13.jar jcommon-1.0.16.jar commons-beanutils-1.8.3
   .jar beansbinding-1.2.1.jar poi-3.6.jar log4j-1.2.13.jar
    poi-ooxml-3.6.jar poi-ooxml-schemas-3.6.jar xmlbeans-2.3.0.jar stax-
   api-1.0.1.jar geronimo-stax-api_1.0_spec-1.0.jar dom4j-1.6.1.jar xml-
   apis-1.0.b2.jar commons-dbcp-1.4.jar commons-pool-1.5.4.jar TableLayo
   ut-20050920.jar
  </code></pre>
  
  <p>Thanks in advance for your help.</p>