title: Ant gets stuck while building runnable jar
body: <p>it's me again.
  I've been trying to create java project into a runnable jar using ant script.
  This is my build.xml</p>
  
  <pre><code>&lt;project name="simple-app" basedir="." default="main"&gt;
      &lt;property name="src.dir" value="src" /&gt;
      &lt;property name="build.dir" value="build" /&gt;
      &lt;property name="classes.dir" value="${build.dir}/classes" /&gt;
      &lt;property name="jar.dir" value="${build.dir}/jar" /&gt;
      &lt;property name="lib.dir" value="lib" /&gt;
      &lt;property name="main-class" value="app.App" /&gt;
  
      &lt;path id="classpath"&gt;
      &lt;fileset dir="${lib.dir}"&gt;
          &lt;include name="*.jar" /&gt;
      &lt;/fileset&gt;
              &lt;dirset dir="${build.dir}"&gt;
              &lt;include name="classes"/&gt;
      &lt;/dirset&gt;
  &lt;/path&gt;
  
  &lt;target name="clean"&gt;
      &lt;delete dir="${build.dir}" /&gt;
  &lt;/target&gt;
  
  &lt;target name="compile"&gt;
      &lt;mkdir dir="${classes.dir}"/&gt;
      &lt;javac source="1.7" target="1.7" includeantruntime="false" srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath" /&gt;
  &lt;/target&gt;
  
  &lt;target name="jar" depends="compile"&gt;
      &lt;mkdir dir="${jar.dir}" /&gt;
      &lt;jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}" includes="*.class"&gt;
          &lt;manifest&gt;
              &lt;attribute name="Main-Class" value="${main-class}" /&gt;
          &lt;/manifest&gt;
      &lt;/jar&gt;
  &lt;/target&gt;
  
  
  &lt;target name="run" depends="jar"&gt;
      &lt;java classname="${main-class}"&gt;
          &lt;classpath&gt;
              &lt;path refid="classpath" /&gt;
              &lt;path location="${jar.dir}/${ant.project.name}.jar" /&gt;
          &lt;/classpath&gt;
      &lt;/java&gt;
  &lt;/target&gt;
  
  &lt;target name="main" depends="clean,run"/&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>All goes well, but when it gets to "run" it gets stuck. Terminal says run: and nothing happens. Waited for 30 minutes, nothing. I tried many other options I found around the internet but those resulted either in the same lag, or threw ClassNotFoundException.</p>
  
  <p>I seriously don't know what, to do. When I make the file with Eclipse, all works fine. Anyone can help me? It's propably something totally stupid, but I just don't see it.
  Thank you very much.</p>