title: Running "java ivy.IVYbot.IVYbot.Main" in target/classes directory returns cannot find main class error
body: <p>I'm trying to use the Windows command line to run my class files. However, when I try to run it, nothing ever works and I only see the </p>
  
  <pre><code>Error: Could not find or load main class Main.
  </code></pre>
  
  <p>I've tried several different solutions all around this site. (The class file I want is located in target/classes/ivy/IVYbot/IVYbot/Main.class.)</p>
  
  <pre><code>&gt; C:\Users\Ivy\Documents\GitHub\IVYbot\target\classes&gt; java ivy.IVYbot.IVYbot.Main
  Error: Could not find or load main class ivy.IVYbot.IVYbot.Main
  
  &gt; C:\Users\Ivy\Documents\Github\IVYbot&gt; java -cp .;.\target\classes Main
  Error: Could not find or load main class Main.
  
  &gt; C:\Users\Ivy\Documents\Github\IVYbot&gt; java -cp .;.\target\classes ivy.IVYbot.IVYbot.Main
  Error: Could not find or load main class ivy.IVYbot.IVYbot.Main.
  
  &gt; C:\Users\Ivy\Documents\Github\IVYbot\target\classes\ivy\IVYbot\IVYbot&gt; java Main
  Error: Could not find or load main class Main.
  </code></pre>
  
  <p>I even tried compiling the entire thing into a .jar file through Maven (with dependencies).</p>
  
  <pre><code>&gt; C:\Users\Ivy\Documents\Github\IVYbot\target&gt; java -jar IVYbot-0.0.1-SNAPSHOT-jar-with-dependencies.jar
  no main manifest attribute, in IVYbot-0.0.1-SNAPSHOT-jar-with-dependencies.jar
  </code></pre>
  
  <p>though it should, as</p>
  
  <pre><code>&gt; C:\Users\Ivy\Documents\Github\IVYbot\target&gt; jar tf IVYbot-0.0.1-SNAPSHOT-jar-with-dependencies.jar
  META-INF/
  META-INF/MANIFEST.MF
  ...
  </code></pre>
  
  <p>shows. I have no idea what's wrong with my pathing. The plugin that I'm using for my Maven, if that's useful:</p>
  
  <pre><code>&lt;build&gt;
      &lt;plugins&gt;
          &lt;plugin&gt;
          &lt;artifactId&gt;maven-assembly-plugin&lt;/artifactId&gt;
          &lt;executions&gt;
            &lt;execution&gt;
              &lt;phase&gt;package&lt;/phase&gt;
              &lt;goals&gt;
                &lt;goal&gt;single&lt;/goal&gt;
              &lt;/goals&gt;
            &lt;/execution&gt;
          &lt;/executions&gt;
          &lt;configuration&gt;
            &lt;descriptorRefs&gt;
              &lt;descriptorRef&gt;jar-with-dependencies&lt;/descriptorRef&gt;
            &lt;/descriptorRefs&gt;
          &lt;/configuration&gt;
        &lt;/plugin&gt;
      &lt;/plugins&gt;
  &lt;/build&gt;
  </code></pre>