title: Ant deployment. Jar can't find the main class
body: <p>Created simple test java project just to learn how to use Ant to deploy an application.
  Java project uses Swing to create JFrame and one JLabel to say "Hello World". It looks like this:</p>
  
  <pre><code>package com.mytest;
  import javax.swing.*;        
  
  public class home {
      private static void createAndShowGUI() {
          JFrame frame = new JFrame("HelloWorldSwing");
          frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
          JLabel label = new JLabel("Hello World");
          frame.getContentPane().add(label);
          frame.pack();
          frame.setVisible(true);
      }
      public static void main(String[] args) {
          javax.swing.SwingUtilities.invokeLater(new Runnable() {
              public void run() {
                  createAndShowGUI();
              }
          });
      }
  }
  </code></pre>
  
  <p>Then I created build.xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;project default="mytest" basedir="."&gt;
    &lt;target name ="mytest" description="Create a jar for the Test project"&gt;
      &lt;echo message="starting MyTest jar creation..." /&gt;
      &lt;jar jarfile="mytest.jar" includes="*.class" basedir="bin"&gt;
          &lt;manifest&gt;
              &lt;attribute name="Created-By" value="1.6.0_04 (Sun Microsystems Inc.)" /&gt;
              &lt;attribute name="Built-By" value="Me" /&gt;
              &lt;attribute name="Implementation-Version" value="1.0" /&gt;
              &lt;attribute name="Main-Class" value="com.mytest.home" /&gt;
          &lt;/manifest&gt;
      &lt;/jar&gt;
      &lt;echo message="MyTest jar created..." /&gt;
    &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>The Problem is, once I run deployment through Eclipse, jar is created, but I can't start it. I get message: <strong>Could not find the main class: com.mytest.home</strong>?</p>
  
  <p>What is wrong? It seems like simple straight forward process. Am I missing something?</p>
  
  <p>Thanks.</p>