title: Gradle jar not running. Could not find or load main class
body: <p>I have created a very basic gradle java project that prints &quot;Hello Word&quot;. The main class builds and runs fine. When i try to run <code>java -jar out\artifacts\helloWorld_jar\helloWorld.jar</code> on the command line it gives me this error</p>
  <pre><code>Error: Could not find or load main class com.exmple.helloWorld
  Caused by: java.lang.ClassNotFoundException: com.exmple.helloWorld
  </code></pre>
  <p>here is how my directory looks</p>
  <pre><code>|-gradle
  |-.idea
  |-build
  |-gradle
  |-META-INF
  |-out
   | -artifacts
   | -helloWorld_jar
   | -helloWorld.jar
  |-src
   |-main
    |-java
     |- com.exmple
      |-helloWorld
   |-test
  |build.gradle
  etc...
  </code></pre>
  <p>My build.gradle file looks like this:</p>
  <pre><code>plugins {
      id 'java'
  }
  
  group 'org.example'
  version '1.0-SNAPSHOT'
  
  repositories {
      mavenCentral()
  }
  jar{
      manifest{
          attributes &quot;Main-Class&quot;: &quot;com.exmple.helloWorld&quot;
      }
  
  }
  dependencies {
      testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
      testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
  }
  
  test {
      useJUnitPlatform()
  }
  
  </code></pre>
  <p>I have tried both single quotes and double quotes and it still runs an error. Any ideas on how to fix this? I have been trying for a few days now.</p>
  <p>PS. example is spelt wrong, but its spelt exmple throughout</p>