title: Gradle - Could not find or load main class
body: <p>I'm trying to run a very simple project using Gradle and running into the following error when using the <code>gradlew run command</code>:</p>
  <blockquote>
  <p>could not find or load main class 'hello.HelloWorld'</p>
  </blockquote>
  <p>Here is my file structure:</p>
  <pre><code>SpringTest
      -src
          -hello
              -HelloWorld.java
              -Greeter.java
      -build
           -libs
           -tmp
      -gradle
           -wrapper
      -build.gradle
      -gradlew
      -gradlew.bat
  </code></pre>
  <p>I excluded the contents of the libs and tmp folders because I didn't think that would be relevant information for this issue, but I can add it in if need be.</p>
  <p>Here is my build.gradle file:</p>
  <pre><code>apply plugin: 'java'
  apply plugin: 'application'
  apply plugin: 'eclipse'
  
  mainClassName = 'hello/HelloWorld'
  
  repositories {
      mavenLocal()
      mavenCentral()
  }
  
  dependencies {
      compile &quot;joda-time:joda-time:2.2&quot;
  }
  
  jar {
      baseName = &quot;gs-gradle&quot;
      version = &quot;0.1.0&quot;
  }
  
  task wrapper(type: Wrapper) {
      gradleVersion = '1.11'
  }
  </code></pre>
  <p>Any idea on how to fix this issue?  I've tried all sorts of things for the <code>mainClassName</code> attribute but nothing seems to work.</p>