title: ant run task : [java] java.lang.NoClassDefFoundError: org/apache/log4j/Logger
body: <p>i try to run my app from ant , the app is using log4j jar 
  i have now this ant task:</p>
  
  <pre><code>&lt;property name="main-class"  value="com.controller.core.Controller"/&gt;
  &lt;target name="dist"  
          description="generate the distribution" &gt;
      &lt;jar jarfile="${dist}/lib/controller.jar" basedir="${build}"&gt;
          &lt;manifest&gt;
              &lt;attribute name="Main-Class" value="${main-class}"/&gt;
          &lt;/manifest&gt;
      &lt;/jar&gt;
  &lt;/target&gt;
       &lt;path id="class.path"&gt;
            &lt;fileset dir="..\lib"&gt;
              &lt;include name="**/*.jar" /&gt;
            &lt;/fileset&gt;      
        &lt;/path&gt;
       &lt;target name="run"&gt;
              &lt;java jar="${dist}/lib/controller.jar" fork="true" &gt;         
              &lt;classpath refid="class.path" /&gt;
              &lt;classpath&gt;
                  &lt;path location="../lib/misc"/&gt;
              &lt;/classpath&gt;
             &lt;/java&gt;      
        &lt;/target&gt;
  </code></pre>
  
  <p>or i even gave it full path but still the same error</p>
  
  <pre><code>&lt;target name="run"&gt;
          &lt;java jar="${dist}/lib/controller.jar" fork="true" &gt;         
              &lt;classpath&gt;
                  &lt;path refid="test.classpath"/&gt;
                  &lt;path location="d:\dev\svn\trunk\lib\misc\log4j.jar"/&gt;
              &lt;/classpath&gt;     
          &lt;/java&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>where the log4j is in the ../lib/misc path . 
  but still im getting this error:</p>
  
  <pre><code>run:
       [java] java.lang.NoClassDefFoundError: org/apache/log4j/Logger
       [java]     at com.controller.core.Controller.&lt;clinit&gt;(Unknown Source)
       [java] Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
       [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
       [java]     at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
       [java]     at java.security.AccessController.doPrivileged(Native Method)
       [java]     at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
       [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:423)
       [java]     at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
       [java]     at java.lang.ClassLoader.loadClass(ClassLoader.java:356)
       [java]     ... 1 more
       [java] Exception in thread "main"
       [java] Java Result: 1
  </code></pre>
  
  <p>now when i run ant with -v flag it gives me this msg :</p>
  
  <pre><code>[java] When using 'jar' attribute classpath-settings are ignored. See the manual for more information.
      [java] Executing 'c:\Program Files (x86)\Java\jdk1.7.0_05\jre\bin\java.exe' with arguments:
      [java] '-classpath'
      [java] 'd:\dev\svn\trunk\lib\misc\log4j.jar'
      [java] '-jar'
      [java] 'D:\dev\svn\trunk\controller\dist\lib\controller.jar'
  </code></pre>
  
  <p>what do i miss here ?</p>