title: Could not find or load main class <classname>
body: <p>I created one Spring boot gradle application. I have specified main class name in my build.gradle as</p>
  
  <pre><code>apply plugin: 'idea'
  apply plugin: 'java'
  apply plugin: 'application'
  apply plugin: 'eclipse'
  
  sourceCompatibility = 1.8
  def appName = 'app'
  buildDir = 'gradle-build'
  mainClassName = 'package.Application'
  dependencies{
     ----
  }
  configurations {
      compile.exclude group: 'ch.qos.logback'
  }
  
  jar {
      baseName = appName
      manifest {
          attributes 'Implementation-Title': 'app',
                  'Implementation-Version': version,
                  'Main-Class': mainClassName
      }
  }
  
  startScripts {
      applicationName = appName
  }
  
  distributions {
      main {
          baseName = appName
      }
  }
  </code></pre>
  
  <p>when i run my main class from eclipse, it is running properly. But when I am executing the jar file that will be generated in gradle-build, it is throwing error "could not find or load main class ".</p>
  
  <p>I am executing the command as</p>
  
  <pre><code>    java -jar app.jar
  </code></pre>
  
  <p>I tried with other commands as well</p>
  
  <pre><code>    java -cp -jar app.jar
      java -cp app.jar
  </code></pre>
  
  <p>In all the cases, I am getting same error.</p>
  
  <p>And my manifest file is like this </p>
  
  <pre><code> Manifest-Version: 1.0
  Implementation-Title: app
  Implementation-Version: 1.0.0
  Main-Class: package.Application
  </code></pre>
  
  <p>Please help me solving this.</p>