title: Java Jar - classpath issue
body: <p>Running out of ideas on the cause of the issue. I have a java jar (built from gradle under intellij if that matters).</p>
  
  <ul>
  <li><p>Jar has a manifest.</p></li>
  <li><p>Launching <code>java -jar MyJar.jar</code> from directory containing jar gives "could not find or load main class companyname.mainclass"</p></li>
  <li><p>Java is reading from manifest as Editing the manifest file inside jar to <code>mainclass2</code> will change the name in the error message</p></li>
  <li><p>Manifest contains only version on a line, then main class attribute on a line, then 2 blank lines</p></li>
  <li><p>All dependencies are in a /lib folder relative to jar so no classpath specified in manifest</p></li>
  <li><p>Opening jar in zip file program shows folder <code>companyname</code> with file in it <code>mainclass</code> so the qualified name is reflected in jar structure. Capitalisation is also correct.</p></li>
  <li><p>Manually specifying class name <code>java -cp MyJar.jar companyname.mainclass</code> gives the same class not found error</p></li>
  <li><p>The class in question does have a main method, and does run fine under the IDE when unpackaged.</p></li>
  </ul>
  
  <p>What am I missing (apart from more and more chunks of hair off my head)?</p>
  
  <p>Edit Additional details:
   - using Java 8</p>
  
  <p>jar structure:</p>
  
  <pre><code>-META-INF
    MANIFEST.MF
  -companyname
    -module
      -interfaces
        interface1.class
      -commands
        baseCommand.class
        register.class
        specialCommand.class
      moduleSpec.class
      moduleProcessor.class
    mainclass.class
  log4j.xml
  springconfig1.xml
  springconfig2.xml
  </code></pre>
  
  <p>Manifest file:</p>
  
  <pre><code>Manifest-Version: 1.0
  Main-Class: companyname.mainclass
  (newline char here)
  (newline char here)
  </code></pre>